Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a94a7f

Browse files
committed
TST: account for asyncio changes in py314
An EventLoop will no longer be implicitly created by `get_event_loop()` Closes #30917
1 parent 776b249 commit 2a94a7f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ def check_alt_backend(alt_backend):
208208
if fig.canvas.toolbar: # i.e toolbar2.
209209
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2)
210210

211+
if backend == 'webagg' and sys.version_info >= (3, 14):
212+
import asyncio
213+
asyncio.set_event_loop(asyncio.new_event_loop())
214+
211215
timer = fig.canvas.new_timer(1.) # Test that floats are cast to int.
212216
timer.add_callback(KeyEvent("key_press_event", fig.canvas, "q")._process)
213217
# Trigger quitting upon draw.

0 commit comments

Comments
 (0)