Skip to content

Commit 3677648

Browse files
authored
Merge pull request #492 from dwskoog/python_312_event_loop_warnings
Fix Python 3.12+, Tornado 6.3+ event loop deprecation warnings
2 parents 53cf185 + 0783d91 commit 3677648

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

streamz/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_io_loop(asynchronous=None):
5151
return client.loop
5252

5353
if not _io_loops:
54-
loop = IOLoop()
54+
loop = IOLoop(make_current=False)
5555
thread = threading.Thread(target=loop.start)
5656
thread.daemon = True
5757
thread.start()

streamz/tests/test_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ def test_timed_window_metadata():
444444
]
445445

446446

447-
def test_timed_window_timedelta(clean): # noqa: F811
447+
@pytest.mark.asyncio
448+
async def test_timed_window_timedelta(clean): # noqa: F811
448449
pytest.importorskip('pandas')
449450
source = Stream(asynchronous=True)
450451
a = source.timed_window('10ms')

streamz/utils_test.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,11 @@ def double(x):
4343

4444
@contextmanager
4545
def pristine_loop():
46-
IOLoop.clear_instance()
47-
IOLoop.clear_current()
48-
loop = IOLoop()
49-
loop.make_current()
46+
loop = IOLoop(make_current=False)
5047
try:
5148
yield loop
5249
finally:
5350
loop.close(all_fds=True)
54-
IOLoop.clear_instance()
55-
IOLoop.clear_current()
5651

5752

5853
def gen_test(timeout=10):

0 commit comments

Comments
 (0)