mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Close subprocess pipes to clean up ResourceWarnings
This commit is contained in:
parent
19a5379c97
commit
de11b189d1
1 changed files with 4 additions and 0 deletions
|
@ -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>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue