Restore skipping tests via raise unittest.SkipTest#13912
Restore skipping tests via raise unittest.SkipTest#13912nicoddemus merged 1 commit intopytest-dev:mainfrom
raise unittest.SkipTest#13912Conversation
3be84b3 to
9609029
Compare
Revert "Remove unused code related to `nose` (pytest-dev#13528)" This reverts commit a620d24 and modifies it adding tests and docs. Fixes pytest-dev#13895
9609029 to
2ef26ee
Compare
| excinfo = call.excinfo | ||
| call2 = CallInfo[None].from_call(lambda: skip(str(excinfo.value)), call.when) | ||
| call.excinfo = call2.excinfo |
There was a problem hiding this comment.
This code is quite hacky, I do wonder why the code in the runner doesn't do the trick:
Lines 407 to 410 in 1ff8c9b
In any case we can analyze it later, for 9.0 reverting seems best.
Backport to 9.0.x: 💚 backport PR created✅ Backport PR branch: Backported as #13916 🤖 @patchback |
Revert "Remove unused code related to `nose` (#13528)" This reverts commit a620d24 and modifies it adding tests and docs. Fixes #13895 (cherry picked from commit 6a47389) Co-authored-by: Bruno Oliveira <[email protected]>
|
For the record, this also fixes use of from unittest import skipIf
@skipIf(True, "skipping")
def test_foo():
pass…which is something |
Backport an upstream fix for handling SkipTest exceptions raised outside unittest.TestCase, which also happens to fix unittest.skipIf() on top-level test functions (needed for dev-python/botocore). Bug: pytest-dev/pytest#13895 Pull-Request: pytest-dev/pytest#13912 Signed-off-by: Michał Górny <[email protected]>
|
Ran into this issue in my code base, too. When will this fix be released as pytest 9.0.1? |
Revert "Remove unused code related to
nose(#13528)"This reverts commit a620d24 and modifies it adding tests and docs.
Fixes #13895