pytest-asyncio
pytest-asyncio copied to clipboard
Asyncio support for pytest
This test passes with version 0.10.0: Pipfile: ``` [packages] pytest-asyncio = "==0.10.0" pytest = "==5.4.3" ``` test_request.py: ``` import pytest class TestFixture: @pytest.mark.asyncio async def test_fixture(self, request): assert request.instance is...
Just shooting this question with reference to https://github.com/pytest-dev/pytest-bdd/issues/223 Is there any way the same can be handled with pytest-asyncio? Hope someone will please help if you have worked on something...
# TLDR; when combining async and sync testcases that use subprocesses, the IOloop childwatcher is not correctly closed. workaround included # How to reproduce ```python import pytest import asyncio import...
This is reworking of the `advance_time` method from #96 and #95 into an event-loop independent fixture. This removes the need to change the event-loop class or policy on the fly....
Right now, this test passes: ```python async def do_something_broken(): assert False @pytest.mark.asyncio async def test_something_broken(): do_something_broken() ``` The reason is that we forgot the `await` in `test_something_broken`, so the broken...
When using [pytest-django](https://github.com/pytest-dev/pytest-django)'s `pytest.mark.django_db` marker in conjunction with `pytest.mark.asyncio`, any writes to the database are not rolled back when the test completes and affect subsequent tests. To test, I created...
Hi. Sometimes async tests hangs when background tasks raises some exception but it's not propagated to test function, it's not a bug in pytest-asyncio but a problem in application code....
I'm trying to figure out why this code sample isn't working. I'm not experienced with asyncio yet, so this is very likely a simple misunderstanding on my part. ```python from...
At [dask.distributed](https://github.com/dask/distributed) we started using `pytest-asyncio` for increasingly many tests. Before this, we've been decorating our plain asyncio tests using our own decorator which is not unlike to what `pytest-asyncio`...
consider the following test: ```python import pytest import asyncio @pytest.mark.asyncio async def test_foo(): def raise_(): raise Exception asyncio.get_running_loop().call_soon(raise_) await asyncio.sleep(0) ``` it passes cleanly. However if you explicitly collect any...