Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail for pytest-asyncio==0.17.0 #5310

Open
sphuber opened this issue Jan 13, 2022 · 3 comments
Open

Tests fail for pytest-asyncio==0.17.0 #5310

sphuber opened this issue Jan 13, 2022 · 3 comments

Comments

@sphuber
Copy link
Contributor

sphuber commented Jan 13, 2022

Since pytest-asyncio==0.17.0 was released on January 13th, the tests are broken. See this build as an example. Tests are failing because the loop is closed (see exception below). This may be because they changed the way async tests are automatically marked in the new version and now the event loop that gets used automatically gets closed after each test.

________________ TestInterruptableTask.test_future_already_set _________________

kwargs = {}
coro = <coroutine object TestInterruptableTask.test_future_already_set at 0x7f0a5d867440>

    @functools.wraps(func)
    def inner(**kwargs):
        coro = func(**kwargs)
        if coro is not None:
>           task = asyncio.ensure_future(coro, loop=_loop)

/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pytest_asyncio/plugin.py:317: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/asyncio/tasks.py:669: in ensure_future
    task = loop.create_task(coro_or_future)
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/asyncio/base_events.py:431: in create_task
    self._check_closed()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_UnixSelectorEventLoop running=False closed=True debug=False>

    def _check_closed(self):
        if self._closed:
>           raise RuntimeError('Event loop is closed')
E           RuntimeError: Event loop is closed

/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/asyncio/base_events.py:510: RuntimeError
@sphuber
Copy link
Contributor Author

sphuber commented Jan 13, 2022

@muhrin would be good if you could have a look

@sphuber
Copy link
Contributor Author

sphuber commented Jan 13, 2022

A upper limit was temporarily imposed in #5309

@danielhollas
Copy link
Collaborator

A upper limit was temporarily imposed in #5309

Just noting that the pin is still there. I'll see if newer pytest-asyncio versions work, and if not how much work it would be to make them work.

https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants