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 self.instance._outcome is None case in #173 #174

Merged
merged 8 commits into from
Dec 10, 2024

Conversation

ydshieh
Copy link
Contributor

@ydshieh ydshieh commented Dec 9, 2024

Fix #173.

When a test is decorated with unittest.skip, self.instance._outcome would be None and we need to take this into account.

@nicoddemus
Copy link
Member

nicoddemus commented Dec 9, 2024

Thanks @ydshieh!

Can you include a test that fails without this patch to ensure we do not regress this in the future by accident? A separate unittest using the reproducer you posted in the issue is enough.

@@ -336,6 +336,32 @@ def test_foo(self):
["collected 1 item", "* 3 xfailed, 1 passed in *"]
)

# A test for https://github.com/pytest-dev/pytest-subtests/issues/173
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only with pytest case.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a CHANGELOG entry?

tests/test_subtests.py Outdated Show resolved Hide resolved
src/pytest_subtests/plugin.py Outdated Show resolved Hide resolved
ydshieh and others added 4 commits December 9, 2024 14:13
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
@ydshieh
Copy link
Contributor Author

ydshieh commented Dec 9, 2024

Let me know if this commit works :-)

@ydshieh ydshieh requested a review from nicoddemus December 9, 2024 20:18
@nicoddemus nicoddemus merged commit 5584285 into pytest-dev:main Dec 10, 2024
12 checks passed
loadams added a commit to microsoft/DeepSpeed that referenced this pull request Dec 10, 2024
The issue we encountered was covered here:
pytest-dev/pytest-subtests#173

And is resolved with the latest changes from this PR:
pytest-dev/pytest-subtests#174, and is
published in the latest version 0.14.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest-subtest 0.14.0 fails with Python 3.9 and 3.10
2 participants