]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)
authorVictor Stinner <vstinner@redhat.com>
Mon, 7 Jan 2019 22:55:57 +0000 (23:55 +0100)
committerGitHub <noreply@github.com>
Mon, 7 Jan 2019 22:55:57 +0000 (23:55 +0100)
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.

Lib/test/test_asyncio/test_sendfile.py
Misc/NEWS.d/next/Tests/2019-01-07-23-34-41.bpo-32710.Hzo1b8.rst [new file with mode: 0644]

index 26e44a3348a5427bce284d37b349878d18185beb..f148fe27e6ad407b77ef9192c4b231279f338a4e 100644 (file)
@@ -18,6 +18,10 @@ except ImportError:
     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 (file)
index 0000000..dd602a9
--- /dev/null
@@ -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.