Skip to content

Commit 77c3a84

Browse files
Merge branch 'main' into doc-syntax-fix
2 parents 6149142 + 3fe80c7 commit 77c3a84

File tree

13 files changed

+177
-91
lines changed

13 files changed

+177
-91
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
tox -e generate-gh-release-notes -- "$VERSION" gh-release-notes.md
6565
6666
- name: Upload release notes
67-
uses: actions/upload-artifact@v4
67+
uses: actions/upload-artifact@v5
6868
with:
6969
name: release-notes
7070
path: gh-release-notes.md

changelog/13895.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore support for skipping tests via ``raise unittest.SkipTest``.

changelog/13896.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The terminal progress plugin added in pytest 9.0 is now automatically disabled when iTerm2 is detected, it generated desktop notifications instead of the desired functionality.

changelog/13904.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the TOML type of the verbosity settings in the API reference from number to string.

doc/en/reference/plugin_list.rst

Lines changed: 95 additions & 79 deletions
Large diffs are not rendered by default.

doc/en/reference/reference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,7 @@ passed multiple times. The expected format is ``name=value``. For example::
25962596
.. code-block:: toml
25972597
25982598
[pytest]
2599-
verbosity_assertions = 2
2599+
verbosity_assertions = "2"
26002600
26012601
.. tab:: ini
26022602

@@ -2618,7 +2618,7 @@ passed multiple times. The expected format is ``name=value``. For example::
26182618
.. code-block:: toml
26192619
26202620
[pytest]
2621-
verbosity_subtests = 1
2621+
verbosity_subtests = "1"
26222622
26232623
.. tab:: ini
26242624

@@ -2645,7 +2645,7 @@ passed multiple times. The expected format is ``name=value``. For example::
26452645
.. code-block:: toml
26462646
26472647
[pytest]
2648-
verbosity_test_cases = 2
2648+
verbosity_test_cases = "2"
26492649
26502650
.. tab:: ini
26512651

src/_pytest/terminal.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import datetime
1717
from functools import partial
1818
import inspect
19+
import os
1920
from pathlib import Path
2021
import platform
2122
import sys
@@ -299,8 +300,15 @@ def mywriter(tags, args):
299300
config.trace.root.setprocessor("pytest:config", mywriter)
300301

301302
if reporter.isatty():
302-
plugin = TerminalProgressPlugin(reporter)
303-
config.pluginmanager.register(plugin, "terminalprogress")
303+
# Some terminals interpret OSC 9;4 as desktop notification,
304+
# skip on those we know (#13896).
305+
should_skip_terminal_progress = (
306+
# iTerm2 (reported on version 3.6.5).
307+
"ITERM_SESSION_ID" in os.environ
308+
)
309+
if not should_skip_terminal_progress:
310+
plugin = TerminalProgressPlugin(reporter)
311+
config.pluginmanager.register(plugin, "terminalprogress")
304312

305313

306314
def getreportopt(config: Config) -> str:

src/_pytest/unittest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None:
476476
except AttributeError:
477477
pass
478478

479+
# Convert unittest.SkipTest to pytest.skip.
480+
# This covers explicit `raise unittest.SkipTest`.
481+
unittest = sys.modules.get("unittest")
482+
if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest):
483+
excinfo = call.excinfo
484+
call2 = CallInfo[None].from_call(lambda: skip(str(excinfo.value)), call.when)
485+
call.excinfo = call2.excinfo
486+
479487

480488
def _is_skipped(obj) -> bool:
481489
"""Return True if the given object has been marked with @unittest.skip."""

testing/plugins_integration/pytest.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[pytest]
22
strict_markers = True
3-
; Temporarily disabled until adds support for pytest 9.
4-
; asyncio_mode = strict
3+
asyncio_mode = strict
54
filterwarnings =
65
error::pytest.PytestWarning
76
ignore:usefixtures.* without arguments has no effect:pytest.PytestWarning

testing/plugins_integration/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
anyio[trio]==4.11.0
22
django==5.2.8
3-
# Temporarily disabled until adds support for pytest 9.
4-
#pytest-asyncio==1.2.0
3+
pytest-asyncio==1.3.0
54
pytest-bdd==8.1.0
65
pytest-cov==7.0.0
76
pytest-django==4.11.1

0 commit comments

Comments
 (0)