bpo-22815: Print unexpected successes in summary in TextTestResult (GH-30138)

This commit is contained in:
Serhiy Storchaka 2021-12-26 13:22:44 +02:00 committed by GitHub
parent a23ab7b6d8
commit 1944434b44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 8 deletions

View file

@ -142,6 +142,12 @@ class TextTestResult(result.TestResult):
self.stream.flush()
self.printErrorList('ERROR', self.errors)
self.printErrorList('FAIL', self.failures)
unexpectedSuccesses = getattr(self, 'unexpectedSuccesses', ())
if unexpectedSuccesses:
self.stream.writeln(self.separator1)
for test in unexpectedSuccesses:
self.stream.writeln(f"UNEXPECTED SUCCESS: {self.getDescription(test)}")
self.stream.flush()
def printErrorList(self, flavour, errors):
for test, err in errors: