bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030)

Previously it returned None if the test class or method was
decorated with a skipping decorator.

Co-authored-by: Iman Tabrizian <iman.tabrizian@gmail.com>
This commit is contained in:
Serhiy Storchaka 2021-08-30 16:16:25 +03:00 committed by GitHub
parent d6cb5dd9e1
commit 7e246a3a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 24 deletions

View file

@ -575,7 +575,7 @@ class TestCase(object):
skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
or getattr(testMethod, '__unittest_skip_why__', ''))
self._addSkip(result, self, skip_why)
return
return result
expecting_failure = (
getattr(self, "__unittest_expecting_failure__", False) or