Revert "bpo-45162: Revert "Remove many old deprecated unittest features"" (GH-92556)

This reverts commit b50322d203.
This commit is contained in:
Serhiy Storchaka 2022-06-26 10:18:06 +03:00 committed by GitHub
parent 38612a05b5
commit c834c02569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 78 additions and 373 deletions

View file

@ -200,15 +200,6 @@ class TextTestRunner(object):
if self.warnings:
# if self.warnings is set, use it to filter all the warnings
warnings.simplefilter(self.warnings)
# if the filter is 'default' or 'always', special-case the
# warnings from the deprecated unittest methods to show them
# no more than once per module, because they can be fairly
# noisy. The -Wd and -Wa flags can be used to bypass this
# only when self.warnings is None.
if self.warnings in ['default', 'always']:
warnings.filterwarnings('module',
category=DeprecationWarning,
message=r'Please use assert\w+ instead.')
startTime = time.perf_counter()
startTestRun = getattr(result, 'startTestRun', None)
if startTestRun is not None: