From c50cccfcc3b3a9ef3fe7a78b7e7271930dc24aee Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 10 Sep 2016 04:19:48 -0400 Subject: test_eintr: Fix ResourceWarning warnings --- Lib/test/eintrdata/eintr_tester.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 4fc79b1..9fbe04d 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)) -- cgit v0.12