-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Missing coverage when using the "redis" library #1671
Comments
Is there a way to reproduce this without running a Redis instance? I get a ConnectionError. |
Oh wow, that's a solid point. I don't know of a way around it at the moment, but I can look into it. Thanks for the response! |
I've tried for a bit to reproduce this issue with asyncio streams (which, drilling down, seems to be where the issue comes up). I haven't been able to do it with just the naive echo client/server that python's documentation lays out. There's something here happening that seems specific to redis-py, and I don't know how to reproduce the issue without a redis instance running :/. I've left an inquiry on their project (basically the same information as here, but with a longer example included, as well) - I'm hoping they have some insights: redis/redis-py#2912 |
I saw that python released a new version for python 3.11.5. I've tried everything again with this new version. I still see the same behavior in coverage, but I am now seeing an additional traceback from redis as the script closes. I thought it might be related to this line of missing coverage. I'm including it here: Exception ignored in: <function StreamWriter.del at 0x7fcd228adb20> |
I'm seeing it using fakeredis, which is what I use to test redis code. |
Any chance you can give us a way to reproduce it? |
This repo was setup in a hurry so things in https://github.com/aw-was-here/redis-cov-test ![]() |
Describe the bug
When using asyncio with redis.asyncio (redispy), some lines that are definitely hit remain mysteriously uncovered, even when using a combination of different concurrency settings
To Reproduce
(I've tried various combinations of concurrency, but I most often leave it blank. I suspect it's not even appropriate for my application, though I'm not certain)
My minimal example (coverage_test.py):
I issue the coverage command with a bash script (coverage.sh) as follows:
The output of the script is:
And the coverage of the file looks like this:
I would expect the last print statement (which is executed, according to the output) to be marked green. I see there are some similar issues (most notably #1082 and #1598), but as I mentioned I haven't found a concurrency setting that mitigates this.
The text was updated successfully, but these errors were encountered: