Merge pull request #5331 from blueyed/conftest
tests: conftest: fix collection of slow/slowest items
This commit is contained in:
commit
5c5966f62d
|
@ -27,9 +27,9 @@ def pytest_collection_modifyitems(config, items):
|
||||||
if "testdir" in fixtures:
|
if "testdir" in fixtures:
|
||||||
if spawn_names.intersection(item.function.__code__.co_names):
|
if spawn_names.intersection(item.function.__code__.co_names):
|
||||||
item.add_marker(pytest.mark.uses_pexpect)
|
item.add_marker(pytest.mark.uses_pexpect)
|
||||||
slow_items.append(item)
|
slowest_items.append(item)
|
||||||
else:
|
else:
|
||||||
slowest_items.append(0)
|
slow_items.append(item)
|
||||||
else:
|
else:
|
||||||
marker = item.get_closest_marker("slow")
|
marker = item.get_closest_marker("slow")
|
||||||
if marker:
|
if marker:
|
||||||
|
@ -37,6 +37,6 @@ def pytest_collection_modifyitems(config, items):
|
||||||
else:
|
else:
|
||||||
fast_items.append(item)
|
fast_items.append(item)
|
||||||
|
|
||||||
items[:] = fast_items + neutral_items + slow_items
|
items[:] = fast_items + neutral_items + slow_items + slowest_items
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
Loading…
Reference in New Issue