Why doesn't coverage.py properly measure Flask's runserver command? Why doesn't coverage.py properly measure Flask's runserver command? flask flask

Why doesn't coverage.py properly measure Flask's runserver command?


So it turns out that the problem is related to the 'reloader' message above. The coverage report is correct when I start Flask like this instead:

coverage run manage.py runserver -R

Output then only contains this:

* Running on http://127.0.0.1:5000/

This way it doesn't start up the server in a separate process, and coverage works great.

I found this solution thanks to this related Django question:

Why doesn't coverage.py properly measure Django's runserver command?