Skip to content

Python 3.14 incompatibility: RuntimeError: There is no current event loop in thread 'MainThread' #14

@alsugiliazova

Description

@alsugiliazova

When using Python 3.14, I encounter the following error on import:

RuntimeError: There is no current event loop in thread 'MainThread'.

The traceback points to:

testflows/_core/parallel/asyncio.py: loop = asyncio.get_event_loop()

This appears to be caused by a change in Python 3.14 behavior:

  • asyncio.get_event_loop() now raises a RuntimeError if no event loop has been set in the current thread.
  • Previously, it would implicitly create one in the main thread.

Since TestFlows calls asyncio.get_event_loop() at import time, the import fails under Python 3.14.

For now, I switched back to Python 3.12 and everything works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions