-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Python Unittest does not return results object when the test is skipped #85786
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
Comments
Result object is null when a test case is skipeed. |
You should justify the proposed change here on the issue, and see if the doc says anything about the issue either way. |
I agree with Iman that this looks like a bug because the code updates the result object with skip info but then doesn't return it. The patch needs a unit test covering this, as well as probably a doc update. |
I'll add a documentation and unit test and update the PR. |
It is a bug because there is a difference between the following cases:
@other_decorator
@skip("skipped")
def test2(self):
...
def test2(self):
self.skipTest("skipped")
... None is only returned in the first case. In other two cases a TestResult is returned with information about skipping. It is obvious that it was unintentionally. I just have fixed similar bug about calling stopTestRun() (bpo-44955). Iman, please add tests and a NEWS entry. You can use tests added in bpo-44955 as an example. |
Thanks for the report and initial patch, Iman! ✨ 🍰 ✨ And thanks Serhiy for pushing this across the finish line. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: