mattjegan
mattjegan

Reputation: 2884

Measuring python coverage at runtime

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'.

Upvotes: 3

Views: 696

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375574

As of version 4.4, you can call coverage.save() and continue running. This means you have to use the coverage.py API inside your program rather than just using the command-line interface.

Upvotes: 3

Related Questions