diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-18 22:11:30 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-18 22:11:30 (GMT) |
commit | 254ad58c0790f3bcf4ca510ba0e8a7c0f1546301 (patch) | |
tree | f906a773422e3d6910a09f2a68177f22c1aac890 | |
parent | 3515dcce80ca51d29a7100ce0c2ac2a50ba46af8 (diff) | |
download | cpython-254ad58c0790f3bcf4ca510ba0e8a7c0f1546301.zip cpython-254ad58c0790f3bcf4ca510ba0e8a7c0f1546301.tar.gz cpython-254ad58c0790f3bcf4ca510ba0e8a7c0f1546301.tar.bz2 |
Fix test_huntrleaks_fd_leak() of test_regrtest
Issue #28195: Don't expect the fd leak message to be on a specific line number,
just make sure that the line is present in the output.
-rw-r--r-- | Lib/test/test_regrtest.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 7c95b64..5de2a6f 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -772,14 +772,11 @@ class ArgsTestCase(BaseTestCase): self.check_line(output, re.escape(line)) line2 = '%s leaked [1, 1, 1] file descriptors, sum=3\n' % test - self.check_line(output, re.escape(line2)) + self.assertIn(line2, output) with open(filename) as fp: reflog = fp.read() - if hasattr(sys, 'getcounts'): - # Types are immportal if COUNT_ALLOCS is defined - reflog = reflog.splitlines(True)[-1] - self.assertEqual(reflog, line2) + self.assertIn(line2, reflog) def test_list_tests(self): # test --list-tests |