-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Code coverage warning: "No source for code: '/my/local/folder/_run_response_middleware'. (couldnt-parse)" #2345
Comments
Why are you running coverage for Sanic? You will not get coverage for these functions because they are rewritten at startup time based upon your application's code. |
I'm trying to run coverage on my server code but hit error/warning on sanic code. this is the place actually confused me. |
And can you explain a little more about this?
|
However you are running coverage, it is including the portions of Sanic that are imported into your application. What version of
Sure! This is an important feature of Sanic going forward. I am myself working out this whole coverage issue because it is a PITA. We handle it currently by simply ignoring those methods. Not ideal. What is happening is that when you first load Sanic, it does some self inspection of the types of handlers that you have setup. Currently it is looking for a few specific items: (1) what signals are implemented by the application; and (2) what In the coming year, there likely will be some more of these introspection style optimizations. |
I am closing this now as the issue is not really related to Sanic. Feel free to continue the conversation. |
@ahopkins respectfully I'd like to reopen this--it is a Sanic issue because of the generated code, which causes confusion with other tools looking for persistent modules. No other package I've used out of ~250 in my current app does this. |
Feel free to create a new issue and reference this. I would ask @rbm-radius if you can provide a use case and a simple repeatable example of how/where this is causing problems. |
@ahopkins done! Let me know if more examples are required. |
Describe the bug
After upgrade sanic from 21.6 to 21.9, coverage, we noticed when run
coverage xml
, there is an error like below:with
coverage xml -i
there are more warnings:Code snippet
In blueprint.py
Create app in a different file:
Expected behavior
No warning or error while generating code coverage report, like using sanic 21.6.
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: