coveragepy
coveragepy copied to clipboard
FAQ: Why do the bodies of functions show as executed, but the def lines do not? - Solution: spawn a new process
from multiprocessing import Process, set_start_method
set_start_method("spawn") process_cov = Process(target=calc_report_coverage, args=(...)) process_cov.start() process_cov.join()
I think you are suggesting that we add this to the FAQ? This seems like a not-great way to solve the problem. Why not use the coverage run command to run coverage and measure all the code? Or maybe I've misunderstood what you are suggesting?