[pypy-commit] pypy apptest-file: --assert=reinterp needs to be passed earlier to have an effect

rlamy pypy.commits at gmail.com
Fri Jul 26 13:40:09 EDT 2019


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: apptest-file
Changeset: r97030:eb81f61e9baa
Date: 2019-07-26 18:39 +0100
http://bitbucket.org/pypy/pypy/changeset/eb81f61e9baa/

Log:	--assert=reinterp needs to be passed earlier to have an effect

diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -38,6 +38,11 @@
 def pytest_report_header():
     return "pytest-%s from %s" % (pytest.__version__, pytest.__file__)
 
+ at pytest.hookimpl(tryfirst=True)
+def pytest_cmdline_preparse(config, args):
+    if not (set(args) & {'-D', '--direct-apptest'}):
+        args.append('--assert=reinterp')
+
 def pytest_configure(config):
     global option
     option = config.option
@@ -48,7 +53,6 @@
     if not mode_A and not mode_D:  # 'own' tests
         from rpython.conftest import LeakFinder
         config.pluginmanager.register(LeakFinder())
-        config.addinivalue_line('addopts', '--assert=reinterp')
 
 def pytest_addoption(parser):
     group = parser.getgroup("pypy options")


More information about the pypy-commit mailing list