From 0eaa475f1c4cd5ed1b47a8dae515821397ef2a43 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 10 Nov 2017 20:52:37 +0200 Subject: [PATCH] Fix #2497: Ignore NotImplementedError raised by set_child_watcher from uvloop. --- CHANGES/2497.bugfix | 1 + aiohttp/test_utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 CHANGES/2497.bugfix diff --git a/CHANGES/2497.bugfix b/CHANGES/2497.bugfix new file mode 100644 index 00000000000..0c640a4a1f9 --- /dev/null +++ b/CHANGES/2497.bugfix @@ -0,0 +1 @@ +Ignore `NotImplementedError` raised by `set_child_watcher` from `uvloop`. diff --git a/aiohttp/test_utils.py b/aiohttp/test_utils.py index dc11f49edb2..0d3bd388b92 100644 --- a/aiohttp/test_utils.py +++ b/aiohttp/test_utils.py @@ -452,7 +452,8 @@ def setup_test_loop(loop_factory=asyncio.new_event_loop): policy = asyncio.get_event_loop_policy() watcher = asyncio.SafeChildWatcher() watcher.attach_loop(loop) - policy.set_child_watcher(watcher) + with contextlib.suppress(NotImplementedError): + policy.set_child_watcher(watcher) return loop