You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to generate test code coverage reports for a Flask application. I'm doing "blackbox" style testing. The problem is that I'm unable to get coverage.py to produce coverage data (.coverage) files during a test run.
No .coverage file is generated, so coverage xml fails.
Expected behavior
A coverage.xml ought to be created which shows that all lines in hello.py are covered
Additional context
The closest issue I could find was: #636, however that issue was closed due to complexity arising from uWSGI. This simply uses the most bare bones Flask app possible.
I'll be opening a parallel issue in the Flask project to gather any insights into concurrency related or settrace issues preventing coverage.py from producing data in my minimal-reproduction.
The text was updated successfully, but these errors were encountered:
With coverage 4.x, you would need to make sure the coverage data file is written. Coverage.py does that with an atexit handler. In 5.x, the data file should be written as the program progresses, so you might not have this issue any more.
Describe the bug
I'm trying to generate test code coverage reports for a Flask application. I'm doing "blackbox" style testing. The problem is that I'm unable to get coverage.py to produce coverage data (
.coverage
) files during a test run.Here's a minimal test case as a small repository:
https://github.com/brycefisher/coveragepy-flask
Here's a recent CircleCI run which demonstrates the problem:
https://circleci.com/gh/brycefisher/coveragepy-flask/13
I suspect that something about how the Flask development server dispatches requests (to threads) is causing trouble for coverage.py.
To Reproduce
How can we reproduce the problem? Please be specific.
pip freeze
is very helpful.Use Python 3.7.0
Run the same commands listed that as on CircleCI:
https://github.com/brycefisher/coveragepy-flask/blob/master/.circleci/config.yml#L42-L62
No .coverage file is generated, so
coverage xml
fails.Expected behavior
A
coverage.xml
ought to be created which shows that all lines in hello.py are coveredAdditional context
The closest issue I could find was: #636, however that issue was closed due to complexity arising from uWSGI. This simply uses the most bare bones Flask app possible.
I'll be opening a parallel issue in the Flask project to gather any insights into concurrency related or
settrace
issues preventing coverage.py from producing data in my minimal-reproduction.The text was updated successfully, but these errors were encountered: