I am generating code coverage for my project. Where it is not showing code coverage for some Python files, those are triggered by a helper module that is using subprocess.run
internally to call those Python files.
I tried including sigterm = True
in .coveragerc
file but that didn’t worked.
To handle this scenario I tried the coverage API Approach, like the below one.
import coverage
cov = coverage.Coverage()
cov.start()
# Below is a method that will execute a bunch of code that needs to be covered.
earth = Planet()
earth.rotate()
cov.stop()
cov.save()
cov.html_report()
But when I run the file, it shows me the below error and coverage is not generating
CoverageWarning: Module Space was previously imported, but not measured (module-not-measured)
self.warn(msg, slug="module-not-measured")
Space is my module name where all the code exists.
I found some details on this in documentation but no info provided on how to bypass this to get the coverage.
@nedbat Can you please help me with it?
Thanks in Advance.