From: Victor Stinner Date: Sat, 10 Sep 2016 08:19:48 +0000 (-0400) Subject: test_eintr: Fix ResourceWarning warnings X-Git-Tag: v3.6.0b1~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c50cccfcc3b3a9ef3fe7a78b7e7271930dc24aee;p=thirdparty%2FPython%2Fcpython.git test_eintr: Fix ResourceWarning warnings --- diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 4fc79b13a1e3..9fbe04de9c5d 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -83,6 +83,9 @@ class OSEINTRTest(EINTRBaseTest): processes = [self.new_sleep_process() for _ in range(num)] for _ in range(num): wait_func() + # Call the Popen method to avoid a ResourceWarning + for proc in processes: + proc.wait() def test_wait(self): self._test_wait_multiple(os.wait) @@ -94,6 +97,8 @@ class OSEINTRTest(EINTRBaseTest): def _test_wait_single(self, wait_func): proc = self.new_sleep_process() wait_func(proc.pid) + # Call the Popen method to avoid a ResourceWarning + proc.wait() def test_waitpid(self): self._test_wait_single(lambda pid: os.waitpid(pid, 0))