mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #21112: Fix regression in unittest.expectedFailure on subclasses.
Patch from Berker Peksag.
This commit is contained in:
parent
5e580da0b6
commit
ed599b7c84
3 changed files with 41 additions and 2 deletions
|
@ -563,8 +563,11 @@ class TestCase(object):
|
|||
finally:
|
||||
result.stopTest(self)
|
||||
return
|
||||
expecting_failure = getattr(testMethod,
|
||||
"__unittest_expecting_failure__", False)
|
||||
expecting_failure_method = getattr(testMethod,
|
||||
"__unittest_expecting_failure__", False)
|
||||
expecting_failure_class = getattr(self,
|
||||
"__unittest_expecting_failure__", False)
|
||||
expecting_failure = expecting_failure_class or expecting_failure_method
|
||||
outcome = _Outcome(result)
|
||||
try:
|
||||
self._outcome = outcome
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue