File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ def pytest_collection_modifyitems(config, items):
1111 """
1212 fast_items = []
1313 slow_items = []
14+ slowest_items = []
1415 neutral_items = []
1516
16- slow_fixturenames = ( "testdir" ,)
17+ spawn_names = { "spawn_pytest" , "spawn" }
1718
1819 for item in items :
1920 try :
@@ -23,12 +24,16 @@ def pytest_collection_modifyitems(config, items):
2324 # (https://github.com/pytest-dev/pytest/issues/5070)
2425 neutral_items .append (item )
2526 else :
26- if any (x for x in fixtures if x in slow_fixturenames ):
27- slow_items .append (item )
27+ if "testdir" in fixtures :
28+ if spawn_names .intersection (item .function .__code__ .co_names ):
29+ item .add_marker (pytest .mark .uses_pexpect )
30+ slow_items .append (item )
31+ else :
32+ slowest_items .append (0 )
2833 else :
2934 marker = item .get_closest_marker ("slow" )
3035 if marker :
31- slow_items .append (item )
36+ slowest_items .append (item )
3237 else :
3338 fast_items .append (item )
3439
Original file line number Diff line number Diff line change @@ -175,6 +175,8 @@ markers =
175175 baz
176176 # conftest.py reorders tests moving slow ones to the end of the list
177177 slow
178+ # experimental mark for all tests using pexpect
179+ uses_pexpect
178180
179181[flake8]
180182max-line-length = 120
You can’t perform that action at this time.
0 commit comments