summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_windows_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-15 13:25:08 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-15 13:25:08 (GMT)
commit9fef5244ebbfddf18889d2b9669f50e2ee3fc449 (patch)
treed3854a28ee4ad0bebc5ea4384513ce2aea1523e2 /Lib/test/test_asyncio/test_windows_utils.py
parentd021c1d3953f95745e30ec4148f324a8d28a29d0 (diff)
parentab8848bc2a64930e0e9a2e56592bb692fb31d9e9 (diff)
downloadcpython-9fef5244ebbfddf18889d2b9669f50e2ee3fc449.zip
cpython-9fef5244ebbfddf18889d2b9669f50e2ee3fc449.tar.gz
cpython-9fef5244ebbfddf18889d2b9669f50e2ee3fc449.tar.bz2
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/test/test_asyncio/test_windows_utils.py')
-rw-r--r--Lib/test/test_asyncio/test_windows_utils.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
index af5c453..d48b8bc 100644
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -3,6 +3,7 @@
import socket
import sys
import unittest
+import warnings
from unittest import mock
if sys.platform != 'win32':
@@ -115,8 +116,10 @@ class PipeTests(unittest.TestCase):
self.assertEqual(p.handle, h)
# check garbage collection of p closes handle
- del p
- support.gc_collect()
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "", ResourceWarning)
+ del p
+ support.gc_collect()
try:
_winapi.CloseHandle(h)
except OSError as e:
@@ -170,7 +173,9 @@ class PopenTests(unittest.TestCase):
self.assertTrue(msg.upper().rstrip().startswith(out))
self.assertTrue(b"stderr".startswith(err))
- p.wait()
+ # The context manager calls wait() and closes resources
+ with p:
+ pass
if __name__ == '__main__':