Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8fb305a
Add pytest-subtests files changes
nicoddemus Sep 20, 2025
9d3eba5
subtests: remove direct pytest import
nicoddemus Sep 20, 2025
728d802
Force using xdist plugin and fix linting
nicoddemus Sep 22, 2025
6a5569f
Replace attr by dataclass
nicoddemus Sep 22, 2025
ff446c0
Add docs
nicoddemus Sep 26, 2025
4befec0
Cleanup internal hacks
nicoddemus Sep 26, 2025
35db790
Code review
nicoddemus Oct 11, 2025
7ba2b51
Code review
nicoddemus Oct 18, 2025
13caaa6
Docs
nicoddemus Oct 18, 2025
a0ab30f
Make top-level tests fail when there are failing subtests
nicoddemus Oct 18, 2025
2fcbfa6
Minor code review
nicoddemus Oct 23, 2025
1d4abb1
Replace separate plugin by config.stash
nicoddemus Oct 23, 2025
65e6b1c
Mention pytest-subtests in the docs
nicoddemus Oct 23, 2025
de80614
More code review
nicoddemus Oct 23, 2025
fee714f
Remove update_report
nicoddemus Oct 23, 2025
c1925d0
Do not suppress pytest.exit() or keyboard interrupt when working with…
nicoddemus Oct 23, 2025
0f3251a
Forward log_level from plugin
nicoddemus Oct 23, 2025
10a9ddb
Add test case for nested subtests
nicoddemus Oct 23, 2025
9c52146
Add "verbosity_subtests" option and revamp tests
nicoddemus Oct 25, 2025
681c139
Update doc/en/reference/reference.rst
nicoddemus Oct 28, 2025
fd4c0bb
Mention verbosity_subtests
nicoddemus Oct 28, 2025
0411e6b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 28, 2025
06c1780
Add test for subtest skip
nicoddemus Nov 1, 2025
d6ec3ce
Ignore case unreachable for coverage
nicoddemus Nov 1, 2025
a8c23ec
Improve coverage
nicoddemus Nov 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for subtest skip
  • Loading branch information
nicoddemus committed Nov 1, 2025
commit 06c1780b26f66958e4413fc17bb7000019e322da
25 changes: 25 additions & 0 deletions testing/test_subtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,31 @@ def test_foo(self):
result = pytester.runpytest()
result.stdout.fnmatch_lines(["* 1 passed in *"])

def test_non_subtest_skip(
self, pytester: pytest.Pytester, monkeypatch: pytest.MonkeyPatch
) -> None:
monkeypatch.setenv("COLUMNS", "120")
pytester.makepyfile(
"""
from unittest import TestCase, main

class T(TestCase):

def test_foo(self):
with self.subTest(msg="subtest"):
assert False, "failed subtest"
self.skipTest('non-subtest skip')
"""
)
# This output might change #13756.
result = pytester.runpytest()
result.stdout.fnmatch_lines(
[
"SUBFAILED[[]subtest[]] test_non_subtest_skip.py::T::test_foo*",
"* 1 failed, 1 skipped in *",
]
)

def test_xfail(
self,
pytester: pytest.Pytester,
Expand Down