File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ def pytest_collection_modifyitems(config, items):
14
14
neutral_items = []
15
15
16
16
slow_fixturenames = ("testdir" ,)
17
+ spawn_names = {"spawn_pytest" , "spawn" }
17
18
18
19
for item in items :
19
20
try :
@@ -23,7 +24,12 @@ def pytest_collection_modifyitems(config, items):
23
24
# (https://github.com/pytest-dev/pytest/issues/5070)
24
25
neutral_items .append (item )
25
26
else :
26
- if any (x for x in fixtures if x in slow_fixturenames ):
27
+ if "testdir" in fixtures and spawn_names .intersection (
28
+ item .function .__code__ .co_names
29
+ ):
30
+ slow_items .append (item )
31
+ item .add_marker (pytest .mark .uses_pexpect )
32
+ elif any (x for x in fixtures if x in slow_fixturenames ):
27
33
slow_items .append (item )
28
34
else :
29
35
marker = item .get_closest_marker ("slow" )
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ markers =
175
175
baz
176
176
# conftest.py reorders tests moving slow ones to the end of the list
177
177
slow
178
+ uses_pexpect
178
179
179
180
[flake8]
180
181
max-line-length = 120
You can’t perform that action at this time.
0 commit comments