Skip to content

Commit 64a4856

Browse files
committed
conftest: add uses_pexpect mark
1 parent e393a73 commit 64a4856

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

testing/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def pytest_collection_modifyitems(config, items):
1313
slow_items = []
1414
neutral_items = []
1515

16-
slow_fixturenames = ("testdir",)
16+
spawn_names = {"spawn_pytest", "spawn"}
1717

1818
for item in items:
1919
try:
@@ -23,7 +23,9 @@ def pytest_collection_modifyitems(config, items):
2323
# (https://github.com/pytest-dev/pytest/issues/5070)
2424
neutral_items.append(item)
2525
else:
26-
if any(x for x in fixtures if x in slow_fixturenames):
26+
if "testdir" in fixtures:
27+
if spawn_names.intersection(item.function.__code__.co_names):
28+
item.add_marker(pytest.mark.uses_pexpect)
2729
slow_items.append(item)
2830
else:
2931
marker = item.get_closest_marker("slow")

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ markers =
175175
baz
176176
# conftest.py reorders tests moving slow ones to the end of the list
177177
slow
178+
uses_pexpect
178179

179180
[flake8]
180181
max-line-length = 120

0 commit comments

Comments
 (0)