Closed Olegt0rr closed 11 months ago
It has taken me a while to debug, but I think I may be experiencing the same.
I get a different error:
______________________________________________ test_foo ______________________________________________
Traceback (most recent call last):
File "repro.py", line 19, in test_foo
await redis.ping()
AttributeError: 'async_generator' object has no attribute 'ping'
More generally, I'm not sure that this is actually a pytest issue. Can you show a minimal reproducing example, where calling your test function with and without -Werror
works without pytest, but fails with pytest?
I forget to copy asyncio_mode = "auto"
to ini_options
, it seems in your case async fixture was not detected as a fixture. Try to run with asyncio mode
Okay, I'll make an example
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
How to reproduce
1. Enable filterwarnings mode
2. Create Redis client fixture
3. Create simple test
4. Install uvloop
Add this to your
conftest.py
5. Run tests
I hope you know how to do it ;)
Expected result
Since
Redis
has unclear behaviour ofredis.close()
method and it doesn't close connection pool, our tests should be failed withResourceWarning
aboutunclosed TCPTransport
Actual result
Test passed and hanged with infinity loading:
P.S.
Only
terminate
+re-run with debug mode
helps to understand what's going on: