bpo-45057: Simplify RegressionTestResult#28081
Conversation
Remove code which duplicates the functionality of TextTestResult.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. Yeah, it looks like most code already exists in Lib/unittest/runner.py.
I didn't check manually if the output remains the same.
| def printErrorList(self, flavor, errors): | ||
| for test, err in errors: | ||
| self.stream.write(self.separator1) | ||
| self.stream.write(f'{flavor}: {self.getDescription(test)}\n') |
There was a problem hiding this comment.
You can modernize printErrors() in Lib/unittest/runner.py. It contains very useless code like "%s" % err.
There was a problem hiding this comment.
Maybe in other PR. This PR does not touch that file.
There was a problem hiding this comment.
As you want, it was just a remark. I approved your PR (and you merged it ;-))
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
GH-28101 is a backport of this pull request to the 3.10 branch. |
Remove code which duplicates the functionality of TextTestResult. (cherry picked from commit 2b76a53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Remove code which duplicates the functionality of TextTestResult.. (cherry picked from commit 2b76a53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-28103 is a backport of this pull request to the 3.9 branch. |
|
For me this change is just refactoring and not bugfix, you can backport it, but usually I prefer to leave stable branches unchanged. |
|
It is internal code, and it can help when backport changes to TextTestResult. I prefer to backport test changes. |
|
|
Remove code which duplicates the functionality of TextTestResult.
https://bugs.python.org/issue45057