diff options
author | 2019-07-25 20:15:24 +0100 | |
---|---|---|
committer | 2019-07-25 20:15:24 +0100 | |
commit | 01f3b1e1206bf0f2ca383fc7eee4c87cb082a5a7 (patch) | |
tree | 79ff595981250061032cec3626ad4190e961156d /pypy/conftest.py | |
parent | hg merge default (diff) | |
download | pypy-01f3b1e1206bf0f2ca383fc7eee4c87cb082a5a7.tar.gz pypy-01f3b1e1206bf0f2ca383fc7eee4c87cb082a5a7.tar.bz2 pypy-01f3b1e1206bf0f2ca383fc7eee4c87cb082a5a7.zip |
Use a separate flag for new-style apptests
Diffstat (limited to 'pypy/conftest.py')
-rw-r--r-- | pypy/conftest.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pypy/conftest.py b/pypy/conftest.py index 2465d3c0e9..1c6e8b75c4 100644 --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -45,13 +45,17 @@ def pytest_addhooks(pluginmanager): def pytest_configure(config): global option option = config.option - config.addinivalue_line('python_files', APPLEVEL_FN) + if config.getoption('direct_apptest') or not config.getoption('runappdirect'): + config.addinivalue_line('python_files', APPLEVEL_FN) def pytest_addoption(parser): group = parser.getgroup("pypy options") group.addoption('-A', '--runappdirect', action="store_true", default=False, dest="runappdirect", - help="run applevel tests directly on python interpreter (not through PyPy)") + help="run legacy applevel tests directly on python interpreter (not through PyPy)") + group.addoption('-D', '--direct-apptest', action="store_true", + default=False, dest="direct_apptest", + help="run applevel_XXX.py tests directly on host interpreter") group.addoption('--direct', action="store_true", default=False, dest="rundirect", help="run pexpect tests directly") @@ -92,7 +96,7 @@ def pytest_sessionstart(session): def pytest_pycollect_makemodule(path, parent): if path.fnmatch(APPLEVEL_FN): - if parent.config.getoption('runappdirect'): + if parent.config.getoption('direct_apptest'): return from pypy.tool.pytest.apptest2 import AppTestModule rewrite = parent.config.getoption('applevel_rewrite') @@ -196,6 +200,8 @@ def pytest_runtest_setup(item): appclass.obj.space = LazyObjSpaceGetter() appclass.obj.runappdirect = option.runappdirect - def pytest_ignore_collect(path, config): + if (config.getoption('direct_apptest') and not path.isdir() + and not path.fnmatch(APPLEVEL_FN)): + return True return path.check(link=1) |