summaryrefslogtreecommitdiff
path: root/Lib/test/test_popen2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_popen2.py')
-rw-r--r--Lib/test/test_popen2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_popen2.py b/Lib/test/test_popen2.py
index 18142ecc13..4db3cd1f55 100644
--- a/Lib/test/test_popen2.py
+++ b/Lib/test/test_popen2.py
@@ -35,6 +35,9 @@ def _test():
# same test as popen2._test(), but using the os.popen*() API
print "Testing os module:"
import popen2
+ # When the test runs, there shouldn't be any open pipes
+ popen2._cleanup()
+ assert not popen2._active, "Active pipes when test starts " + repr([c.cmd for c in popen2._active])
cmd = "cat"
teststr = "ab cd\n"
if os.name == "nt":
@@ -65,6 +68,7 @@ def _test():
raise ValueError("unexpected %r on stderr" % (got,))
for inst in popen2._active[:]:
inst.wait()
+ popen2._cleanup()
if popen2._active:
raise ValueError("_active not empty")
print "All OK"