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

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>
(cherry picked from commit 7e246a3a7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-08-30 06:42:34 -07:00 committed by GitHub
parent 576803d7a8
commit 0c5e0aa73f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 24 deletions

View file

@ -574,7 +574,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