Is it possible to measure python code coverage at runtime and view the results as they are generated? I tried using coverage but couldn't find an option that would help. My initial experiments show that the .coverage file isn't saved to until the end of the programs execution, meaning we can't view the results using 'coverage html' or 'coverage report'.
-
Do you not have a way to end your program cleanly?Ned Batchelder– Ned Batchelder2017-07-18 10:34:37 +00:00Commented Jul 18, 2017 at 10:34
-
@NedBatchelder my use case is more for if I have a continuously running program like a web server and I wanted to see where my code hasn't been touched over a longer period of timemattjegan– mattjegan2017-07-18 10:39:18 +00:00Commented Jul 18, 2017 at 10:39
-
Maybe adding a way to end the server will be easier than using the coverage API in the code.Ned Batchelder– Ned Batchelder2017-07-18 14:54:33 +00:00Commented Jul 18, 2017 at 14:54
-
@NedBatchelder perhaps during development that would be fine. I was thinking of a production environment where interrupting the server is probably not a good idea. Perhaps I'll make a PR into coverage at some point to add this.mattjegan– mattjegan2017-07-18 21:17:33 +00:00Commented Jul 18, 2017 at 21:17
-
If you want to take it on, drop me an email so we can discuss the design.Ned Batchelder– Ned Batchelder2017-07-19 01:56:30 +00:00Commented Jul 19, 2017 at 1:56
Add a comment
|