-
Notifications
You must be signed in to change notification settings - Fork 159
pytest-asyncio breaks on pytest 5.4.2 when subclassing from unittest.TestCase #180
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
Comments
Bisected to pytest-dev/pytest@da615a4 which is the backport of pytest-dev/pytest#7144. cc @nicoddemus |
Thanks! I will take a look ASAP. 👍 |
async test methods of Changing the example to use import asynctest
import pytest
class SimpleTest(asynctest.TestCase):
async def test_service_request(self):
assert False You don't even need the mark anymore, as now If you don't subclass from import asynctest
import pytest
class SimpleTest(asynctest.TestCase):
async def test_service_request(self):
assert False
class Test:
@pytest.mark.asyncio
async def test_service_request2(self):
assert False
@pytest.mark.asyncio
async def test_service_request3():
assert False (all 3 tests above fail as expected) The |
Ah I did not know asynctest.TestCase was a thing, this resolves my use case. Feel free to close the issue if using unittest.TestCase is not supported. |
Don't know if it's relevant but Python 3.8 also has |
Thanks @JonathanBrouwer! I'm closing this for now then. I believe if support for plain |
Uh oh!
There was an error while loading. Please reload this page.
System information:
Manjaro Linux with 5.7 kernel
Python 3.8.3
pip 20.1.1
I am using pytest with pytest-asyncio.
I am running the following test:
Using pytest 5.4.1 and pytest-asyncio 0.14.0 this test fails (as it should)
Using pytest 5.4.2 and pytest-asyncio 0.14.0 this test passes
Using pytest 6.0.1 and pytest-asyncio 0.14.0 this test passes
On pytest 5.4.2, the following is printed in the console (Note the warning)
Pip list output:
The text was updated successfully, but these errors were encountered: