Fix transient refleak in test_popen2.

This commit is contained in:
Florent Xicluna 2010-03-04 15:57:20 +00:00
parent 7c924ec925
commit a36e245deb
1 changed files with 7 additions and 1 deletions

View File

@ -50,7 +50,13 @@ class Popen2Test(unittest.TestCase):
for inst in popen2._active: for inst in popen2._active:
inst.wait() inst.wait()
popen2._cleanup() popen2._cleanup()
self.assertFalse(popen2._active, "_active not empty") self.assertFalse(popen2._active, "popen2._active not empty")
# The os.popen*() API delegates to the subprocess module (on Unix)
import subprocess
for inst in subprocess._active:
inst.wait()
subprocess._cleanup()
self.assertFalse(subprocess._active, "subprocess._active not empty")
reap_children() reap_children()
def validate_output(self, teststr, expected_out, r, w, e=None): def validate_output(self, teststr, expected_out, r, w, e=None):