[Python-checkins] bpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)

Victor Stinner webhook-mailer at python.org
Mon Jan 7 17:56:11 EST 2019


https://github.com/python/cpython/commit/df8e1fb4e388e18430a9be8c6ceeb03c330f166c
commit: df8e1fb4e388e18430a9be8c6ceeb03c330f166c
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-01-07T23:55:57+01:00
summary:

bpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)

test_asyncio/test_sendfile.py now resets the event loop policy using
tearDownModule() as done in other tests, to prevent a warning when
running tests on Windows.

files:
A Misc/NEWS.d/next/Tests/2019-01-07-23-34-41.bpo-32710.Hzo1b8.rst
M Lib/test/test_asyncio/test_sendfile.py

diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py
index 26e44a3348a5..f148fe27e6ad 100644
--- a/Lib/test/test_asyncio/test_sendfile.py
+++ b/Lib/test/test_asyncio/test_sendfile.py
@@ -18,6 +18,10 @@
     ssl = None
 
 
+def tearDownModule():
+    asyncio.set_event_loop_policy(None)
+
+
 class MySendfileProto(asyncio.Protocol):
 
     def __init__(self, loop=None, close_after=0):
diff --git a/Misc/NEWS.d/next/Tests/2019-01-07-23-34-41.bpo-32710.Hzo1b8.rst b/Misc/NEWS.d/next/Tests/2019-01-07-23-34-41.bpo-32710.Hzo1b8.rst
new file mode 100644
index 000000000000..dd602a94c349
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-01-07-23-34-41.bpo-32710.Hzo1b8.rst
@@ -0,0 +1,3 @@
+``test_asyncio/test_sendfile.py`` now resets the event loop policy using
+:func:`tearDownModule` as done in other tests, to prevent a warning when
+running tests on Windows.



More information about the Python-checkins mailing list