Comments (7)
I don't have access to a desktop computer right now but I think I might know what's causing this. Thanks for reporting, will look into it asap.
from pytest-asyncio.
If I'm right the test is being executed (you can verify with a print inside and running pytest with -s), just the assert exceptions are being swallowed. 😕
from pytest-asyncio.
Yes, you're right. Here's the updated code:
import pytest
@pytest.mark.asyncio
async def test_foo():
print('hello')
assert False
print('world')
And the output from py.test test_foo.py -s -v
:
===================================================== test session starts =====================================================
platform linux -- Python 3.5.1+, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /home/catlee/test/pytest-async/bin/python3.5
cachedir: .cache
rootdir: /home/catlee/test/pytest-async, inifile:
plugins: asyncio-0.4.0
collected 1 items
test_foo.py::test_foo hello
PASSED
from pytest-asyncio.
Will be fixed tomorrow 👍 Thanks!
from pytest-asyncio.
Hi, I've just pushed 0.4.1 to PyPI. Can you confirm it fixes the issue for you?
from pytest-asyncio.
Yes, 0.4.1 works, thanks!
from pytest-asyncio.
Great :)
from pytest-asyncio.
Related Issues (20)
- Support for Pytest 8.0 HOT 14
- pytest-asyncio makes pytest collect modules not matching `python_files`, causing `ModuleNotFoundError` HOT 3
- Startup failure on Windows with Version 0.23.3 HOT 1
- 0.23.3 breaking ImportError exception HOT 1
- documentation on how to force all tests in one session to use the same event loop appears to not force fixtures into the same event loop HOT 4
- TypeError: __call__() got an unexpected keyword argument 'specname' in version 0.23 pytest-asyncio HOT 3
- Python 3.11: DeprecationWarning: There is no current event loop HOT 12
- Hypothesis integration raises internal error when collecting `RuleBasedStateMachine` HOT 2
- AsyncGenerator early exit doesn't raise CancelledError and doesn't run `finally` branch HOT 4
- RuntimeError: "Timeout context manager should be used inside a task" in aiohttp with version 0.23 pytest-asyncio HOT 1
- pytest 8.0.0 AttributeError: 'Package' object has no attribute 'obj' HOT 2
- AttributeError: '_UnixSelectorEventLoop' object has no attribute '_compute_internal_coro' HOT 1
- Drop support for pytest 7
- Factory fixtures are causing `'Coroutine' object is not callable` warning in UI, but tests still run HOT 3
- Configuration option for default loop scope
- Can't async mock a method in a context manager HOT 2
- Parametrizing `event_loop_policy` parametrizes all tests
- Not compatible with --doctest-modules --doctest-ignore-import-errors HOT 1
- How to use event_loop_policy without triggering warnings? HOT 1
- "The test […] is not an async function" when `asyncio` marker is added via `pytest_collection_modifyitems()` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-asyncio.