MCPcopy Create free account
hub / github.com/python/cpython / test_huntrleaks_fd_leak

Method test_huntrleaks_fd_leak

Lib/test/test_regrtest.py:1368–1379  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1366
1367 @unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
1368 def test_huntrleaks_fd_leak(self):
1369 # test --huntrleaks for file descriptor leak
1370 code = textwrap.dedent("""
1371 import os
1372 import unittest
1373
1374 class FDLeakTest(unittest.TestCase):
1375 def test_leak(self):
1376 fd = os.open(__file__, os.O_RDONLY)
1377 # bug: never close the file descriptor
1378 """)
1379 self.check_leak(code, 'file descriptors')
1380
1381 def test_list_tests(self):
1382 # test --list-tests

Callers

nothing calls this directly

Calls 2

check_leakMethod · 0.95
dedentMethod · 0.45

Tested by

no test coverage detected