Skip to content

Commit c30312a

Browse files
TEMP: Fix test for Python3.14
It started raising a RuntimeError if there was no loop running.
1 parent e319f73 commit c30312a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/sim_asyncio_ioc_override.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737

3838
# Run the IOC
3939
builder.LoadDatabase()
40-
event_loop = asyncio.get_event_loop()
40+
try:
41+
event_loop = asyncio.get_event_loop()
42+
except RuntimeError:
43+
event_loop = asyncio.new_event_loop()
4144
worker = threading.Thread(target=event_loop.run_forever)
4245
worker.daemon = True
4346
worker.start()
@@ -49,6 +52,7 @@
4952
try:
5053
from pytest_cov.embed import cleanup
5154
sys._run_exitfuncs = cleanup
55+
5256
except ImportError:
5357
# Note that pytest_cov.embed no longer exists in pytest_cov>=7.0.0
5458
pass

0 commit comments

Comments
 (0)