Skip to content

Commit 254ad58

Browse files
committed
Fix test_huntrleaks_fd_leak() of test_regrtest
Issue python#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.
1 parent 3515dcc commit 254ad58

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Lib/test/test_regrtest.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -772,14 +772,11 @@ def test_leak(self):
772772
self.check_line(output, re.escape(line))
773773

774774
line2 = '%s leaked [1, 1, 1] file descriptors, sum=3\n' % test
775-
self.check_line(output, re.escape(line2))
775+
self.assertIn(line2, output)
776776

777777
with open(filename) as fp:
778778
reflog = fp.read()
779-
if hasattr(sys, 'getcounts'):
780-
# Types are immportal if COUNT_ALLOCS is defined
781-
reflog = reflog.splitlines(True)[-1]
782-
self.assertEqual(reflog, line2)
779+
self.assertIn(line2, reflog)
783780

784781
def test_list_tests(self):
785782
# test --list-tests

0 commit comments

Comments
 (0)