Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix skipTest inside subTest #169

Merged
merged 31 commits into from
Dec 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c62d3ae
fix
ydshieh Nov 18, 2024
c5c02fa
fix more: non subtest skip cases
ydshieh Nov 18, 2024
a439226
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 18, 2024
866c990
fix: # type: ignore[method-assign]
ydshieh Nov 18, 2024
590624d
Merge branch 'fix_skip' of https://github.com/ydshieh/pytest-subtests…
ydshieh Nov 18, 2024
a737260
fix more: # type: ignore[attr-defined]
ydshieh Nov 18, 2024
2e38614
fix more: # type: ignore[attr-defined]
ydshieh Nov 18, 2024
d7f0fa5
fix more: # type: ignore[attr-defined]
ydshieh Nov 18, 2024
aa4a17b
fix more: # type: ignore[attr-defined]
ydshieh Nov 18, 2024
d6e9e5e
fix more: # type: ignore[attr-defined]
ydshieh Nov 18, 2024
a99ea3b
fix None exec_info in subtest error
ydshieh Nov 18, 2024
07ef703
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 18, 2024
67993fe
remove copy
ydshieh Nov 20, 2024
23929b5
style
ydshieh Nov 20, 2024
7461dd6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 20, 2024
92e427c
comment
ydshieh Nov 20, 2024
a9c852e
fix python versions
ydshieh Nov 21, 2024
f9c0fba
fix recursion
ydshieh Nov 21, 2024
aecfe7a
fix recursion
ydshieh Nov 21, 2024
87fcb67
Add first test
ydshieh Nov 21, 2024
01c2b12
Add first test
ydshieh Nov 21, 2024
450e81e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
fd94cb9
add more tests
ydshieh Nov 21, 2024
f75438d
add more tests
ydshieh Nov 21, 2024
d14628b
Merge branch 'fix_skip' of https://github.com/ydshieh/pytest-subtests…
ydshieh Nov 21, 2024
15612c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
9c4af2d
Fix tests due to column size
nicoddemus Dec 7, 2024
3b6c4ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2024
35711d8
Update CHANGELOG
nicoddemus Dec 7, 2024
475a356
Fix tests due to column size
nicoddemus Dec 7, 2024
da27259
Import protected _SubTest locally
nicoddemus Dec 7, 2024
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
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Nov 18, 2024
commit 07ef703f7ff2a3bb62a2dca124afcd59b109c205
10 changes: 8 additions & 2 deletions src/pytest_subtests/plugin.py
Original file line number Diff line number Diff line change
@@ -111,7 +111,11 @@ def _addSkip(self: TestCaseFunction, testcase: TestCase, reason: str) -> None:
# `_addSubTest`.
if (
len(
[x for x, y in self.instance._outcome.errors if isinstance(x, _SubTest) and y is not None]
[
x
for x, y in self.instance._outcome.errors
if isinstance(x, _SubTest) and y is not None
]
ydshieh marked this conversation as resolved.
Show resolved Hide resolved
)
== 0
):
@@ -149,7 +153,9 @@ def _addSubTest(
if not isinstance(x, _SubTest)
]
subtest_errors = [
(x, y) for x, y in self.instance._outcome.errors if isinstance(x, _SubTest) and y is not None
(x, y)
for x, y in self.instance._outcome.errors
if isinstance(x, _SubTest) and y is not None
]
if len(subtest_errors) > 0 and len(non_subtest_skip) > 0:
ydshieh marked this conversation as resolved.
Show resolved Hide resolved
last_subset_error = subtest_errors[-1]