Merge pull request #6076 from blueyed/runpytest_subprocess-slowest

tests: conftest: handle tests using runpytest_subprocess as "slowest"
This commit is contained in:
Daniel Hahler 2019-10-28 14:49:54 +01:00 committed by GitHub
commit 6d33f4cdce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -39,9 +39,12 @@ def pytest_collection_modifyitems(config, items):
neutral_items.append(item)
else:
if "testdir" in fixtures:
if spawn_names.intersection(item.function.__code__.co_names):
co_names = item.function.__code__.co_names
if spawn_names.intersection(co_names):
item.add_marker(pytest.mark.uses_pexpect)
slowest_items.append(item)
elif "runpytest_subprocess" in co_names:
slowest_items.append(item)
else:
slow_items.append(item)
item.add_marker(pytest.mark.slow)