diff options
author | Brian Curtin <brian.curtin@gmail.com> | 2010-11-05 17:22:46 (GMT) |
---|---|---|
committer | Brian Curtin <brian.curtin@gmail.com> | 2010-11-05 17:22:46 (GMT) |
commit | de11b189d1e771053fa3e662b2b08116998a73bc (patch) | |
tree | 27d2033dbd2817a5d11ffaca76d42a7203f1fbee /Lib/test/test_threading.py | |
parent | 19a5379c97dbefad4c55922467971937ad354b04 (diff) | |
download | cpython-de11b189d1e771053fa3e662b2b08116998a73bc.zip cpython-de11b189d1e771053fa3e662b2b08116998a73bc.tar.gz cpython-de11b189d1e771053fa3e662b2b08116998a73bc.tar.bz2 |
Close subprocess pipes to clean up ResourceWarnings
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 784f95b..b2a5881 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -327,6 +327,8 @@ class ThreadTests(BaseTestCase): """], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.addCleanup(p.stdout.close) + self.addCleanup(p.stderr.close) stdout, stderr = p.communicate() rc = p.returncode self.assertFalse(rc == 2, "interpreted was blocked") @@ -352,6 +354,8 @@ class ThreadTests(BaseTestCase): """], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.addCleanup(p.stdout.close) + self.addCleanup(p.stderr.close) stdout, stderr = p.communicate() self.assertEqual(stdout.strip(), b"Woke up, sleep function is: <built-in function sleep>") |