]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-18174: Fix file descriptor leaks in tests (GH-7408)
authorVictor Stinner <vstinner@redhat.com>
Mon, 4 Jun 2018 22:36:42 +0000 (00:36 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Jun 2018 22:36:42 +0000 (00:36 +0200)
commit270581905cab2747ae8f7ee945301d6a29509cc7
tree167ca14b175eeee073b478900054eba15fdac671
parent146351860a34b3cde387930a360e57391e7b99f3
bpo-18174: Fix file descriptor leaks in tests (GH-7408)

* test_tempfile.test_no_leak_fd() mocks os.close() but it doesn't
  call the original os.close() method and so leaks an open file
  descriptor. Fix the test by calling the original os.close()
  function.
* test_posix.test_fdopen_directory(): close the directory file
  descriptor when the test completes.
Lib/test/test_posix.py
Lib/test/test_tempfile.py