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

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

This reverts commit b0a6ede3d0.

We're deferring this change until 3.12 while upstream projects that use
the legacy assertion method names are fixed.  See the issue for links
to the discussion. Many upstream projects now have issues and PRs
filed.
This commit is contained in:
Gregory P. Smith 2022-01-26 20:39:15 -08:00 committed by GitHub
parent 9f0881476e
commit b50322d203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 376 additions and 55 deletions

View file

@ -460,14 +460,14 @@ class TestCommandLineArgs(unittest.TestCase):
return stderr.decode()
t = '_test_warnings'
self.assertIn('Ran 5 tests', run_unittest([t]))
self.assertIn('Ran 5 tests', run_unittest(['-k', 'TestWarnings', t]))
self.assertIn('Ran 5 tests', run_unittest(['discover', '-p', '*_test*', '-k', 'TestWarnings']))
self.assertIn('Ran 1 test ', run_unittest(['-k', 'f', t]))
self.assertIn('Ran 5 tests', run_unittest(['-k', 't', t]))
self.assertIn('Ran 2 tests', run_unittest(['-k', '*t', t]))
self.assertIn('Ran 5 tests', run_unittest(['-k', '*test_warnings.*Warning*', t]))
self.assertIn('Ran 1 test ', run_unittest(['-k', '*test_warnings.*warning*', t]))
self.assertIn('Ran 7 tests', run_unittest([t]))
self.assertIn('Ran 7 tests', run_unittest(['-k', 'TestWarnings', t]))
self.assertIn('Ran 7 tests', run_unittest(['discover', '-p', '*_test*', '-k', 'TestWarnings']))
self.assertIn('Ran 2 tests', run_unittest(['-k', 'f', t]))
self.assertIn('Ran 7 tests', run_unittest(['-k', 't', t]))
self.assertIn('Ran 3 tests', run_unittest(['-k', '*t', t]))
self.assertIn('Ran 7 tests', run_unittest(['-k', '*test_warnings.*Warning*', t]))
self.assertIn('Ran 1 test', run_unittest(['-k', '*test_warnings.*warning*', t]))
if __name__ == '__main__':