diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-17 10:33:27 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 10:33:27 (GMT) |
| commit | b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b (patch) | |
| tree | f370600a4be7de179a40cfb81ade054a1f520b2a /Lib/unittest/test/test_runner.py | |
| parent | 0361335b80b435ca3694981b41f8269e390eb892 (diff) | |
| download | cpython-b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b.zip cpython-b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b.tar.gz cpython-b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b.tar.bz2 | |
bpo-45162: Remove many old deprecated unittest features (GH-28268)
* "fail*" and "assert*" aliases of TestCase methods.
* Broken from start TestCase method assertDictContainsSubset().
* Ignored TestLoader.loadTestsFromModule() parameter use_load_tests.
* Old alias _TextTestResult of TextTestResult.
Diffstat (limited to 'Lib/unittest/test/test_runner.py')
| -rw-r--r-- | Lib/unittest/test/test_runner.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py index 453e6c3..6dc3cf6 100644 --- a/Lib/unittest/test/test_runner.py +++ b/Lib/unittest/test/test_runner.py @@ -1146,8 +1146,6 @@ class Test_TextTestRunner(unittest.TestCase): return [b.splitlines() for b in p.communicate()] opts = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=os.path.dirname(__file__)) - ae_msg = b'Please use assertEqual instead.' - at_msg = b'Please use assertTrue instead.' # no args -> all the warnings are printed, unittest warnings only once p = subprocess.Popen([sys.executable, '-E', '_test_warnings.py'], **opts) @@ -1155,11 +1153,11 @@ class Test_TextTestRunner(unittest.TestCase): out, err = get_parse_out_err(p) self.assertIn(b'OK', err) # check that the total number of warnings in the output is correct - self.assertEqual(len(out), 12) + self.assertEqual(len(out), 10) # check that the numbers of the different kind of warnings is correct for msg in [b'dw', b'iw', b'uw']: self.assertEqual(out.count(msg), 3) - for msg in [ae_msg, at_msg, b'rw']: + for msg in [b'rw']: self.assertEqual(out.count(msg), 1) args_list = ( @@ -1186,11 +1184,9 @@ class Test_TextTestRunner(unittest.TestCase): with p: out, err = get_parse_out_err(p) self.assertIn(b'OK', err) - self.assertEqual(len(out), 14) + self.assertEqual(len(out), 12) for msg in [b'dw', b'iw', b'uw', b'rw']: self.assertEqual(out.count(msg), 3) - for msg in [ae_msg, at_msg]: - self.assertEqual(out.count(msg), 1) def testStdErrLookedUpAtInstantiationTime(self): # see issue 10786 |
