diff --git a/streamz/core.py b/streamz/core.py index 02d77dfc..ae7a27f9 100644 --- a/streamz/core.py +++ b/streamz/core.py @@ -51,7 +51,7 @@ def get_io_loop(asynchronous=None): return client.loop if not _io_loops: - loop = IOLoop() + loop = IOLoop(make_current=False) thread = threading.Thread(target=loop.start) thread.daemon = True thread.start() diff --git a/streamz/tests/test_core.py b/streamz/tests/test_core.py index b1c51280..96ab9a24 100644 --- a/streamz/tests/test_core.py +++ b/streamz/tests/test_core.py @@ -444,7 +444,8 @@ def test_timed_window_metadata(): ] -def test_timed_window_timedelta(clean): # noqa: F811 +@pytest.mark.asyncio +async def test_timed_window_timedelta(clean): # noqa: F811 pytest.importorskip('pandas') source = Stream(asynchronous=True) a = source.timed_window('10ms') diff --git a/streamz/utils_test.py b/streamz/utils_test.py index 9dbc1749..6ff76ad7 100644 --- a/streamz/utils_test.py +++ b/streamz/utils_test.py @@ -43,16 +43,11 @@ def double(x): @contextmanager def pristine_loop(): - IOLoop.clear_instance() - IOLoop.clear_current() - loop = IOLoop() - loop.make_current() + loop = IOLoop(make_current=False) try: yield loop finally: loop.close(all_fds=True) - IOLoop.clear_instance() - IOLoop.clear_current() def gen_test(timeout=10):