coverage.py does not cover script if py.test executes it from another directory
问题 I got a python script which takes command line arguments, working with some files. I'm writing succeeding tests with py.test putting this script through its paces, executing it with subprocess.call . Now I want to analyze code coverage with coverage.py . Coverage, when used via the pytest-cov plugin (which has subprocess-handling built-in), does not see/cover my script when it is called from a temporary testing directory created with py.test 's tmpdir fixture. Coverage does see my script when