Skip to content

Commit b0f0908

Browse files
authored
Merge master into features (#5332)
Merge master into features
2 parents 84569ca + af21e6b commit b0f0908

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ Removals
627627
See our `docs <https://docs.pytest.org/en/latest/deprecations.html#passing-command-line-string-to-pytest-main>`__ on information on how to update your code.
628628

629629

630-
- `#3086 <https://github.com/pytest-dev/pytest/issues/3086>`_: ``[pytest]`` section in **setup.cfg** files is not longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files
630+
- `#3086 <https://github.com/pytest-dev/pytest/issues/3086>`_: ``[pytest]`` section in **setup.cfg** files is no longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files
631631
are meant for use with ``distutils``, and a section named ``pytest`` has notoriously been a source of conflicts and bugs.
632632

633633
Note that for **pytest.ini** and **tox.ini** files the section remains ``[pytest]``.
@@ -1849,7 +1849,7 @@ Features
18491849
exits the debugger. On python 3.2 and higher, use CTRL+D. (`#3299
18501850
<https://github.com/pytest-dev/pytest/issues/3299>`_)
18511851

1852-
- pytest not longer changes the log level of the root logger when the
1852+
- pytest no longer changes the log level of the root logger when the
18531853
``log-level`` parameter has greater numeric value than that of the level of
18541854
the root logger, which makes it play better with custom logging configuration
18551855
in user code. (`#3307 <https://github.com/pytest-dev/pytest/issues/3307>`_)

testing/conftest.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff 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,15 +24,19 @@ 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+
slowest_items.append(item)
31+
else:
32+
slow_items.append(item)
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

35-
items[:] = fast_items + neutral_items + slow_items
40+
items[:] = fast_items + neutral_items + slow_items + slowest_items
3641

3742
yield

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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]
180182
max-line-length = 120

0 commit comments

Comments
 (0)