diff options
author | Brett Cannon <brettcannon@users.noreply.github.com> | 2018-06-02 03:34:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-02 03:34:09 (GMT) |
commit | 8425de4147eb8d83befbb8ea77516fc764bb4309 (patch) | |
tree | e07959e28d2c69c12aabd580ecb35e7a968783d3 /Lib/test/support | |
parent | de6516264e793be991f692fdd892707afb9104a7 (diff) | |
download | cpython-8425de4147eb8d83befbb8ea77516fc764bb4309.zip cpython-8425de4147eb8d83befbb8ea77516fc764bb4309.tar.gz cpython-8425de4147eb8d83befbb8ea77516fc764bb4309.tar.bz2 |
bpo-33562: Check the global asyncio event loop policy isn't set after any tests (GH-7328)
Diffstat (limited to 'Lib/test/support')
-rw-r--r-- | Lib/test/support/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index a6fcb1b..1015dd9 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3,6 +3,7 @@ if __name__ != 'test.support': raise ImportError('support must be imported from the test package') +import asyncio.events import collections.abc import contextlib import errno @@ -2878,3 +2879,8 @@ class FakePath: raise self.path else: return self.path + + +def maybe_get_event_loop_policy(): + """Return the global event loop policy if one is set, else return None.""" + return asyncio.events._event_loop_policy |