I am interested in capturing python coverage of both a pip installed package and the python standard library. When I add this code snippet to the beginning of my program, I am able to capture coverage of the standard library. import atexit import coverage cov = coverage.coverage(data_file='tempfile', cover_pylib=True, branch=True) cov.start() # Register an exist handler that will print coverage def exit_handler(): cov.stop() cov.save() atexit.register(exit_handler) However, when I try to add the name of the package I am interested in as a source argument, only the coverage of that package is captured. ex: coverage.coverage(data_file='tempfile', cover_pylib=True, source=["numpy"], branch=True) It seems that the cover_pylib and source arguments are exclusive to each other. Ideally, I would like to be able to capture the coverage across all packages and the standard library. I'd also prefer not to directly take the source code of the package and put it in my working directory since I'd also like to capture coverage of any package the original package depends on. Continue reading...