coverage tools fail on relative source path
See original GitHub issueOriginally reported by Dima Tisnek (Bitbucket: dimaqq, GitHub: dimaqq)
d = coverage.data.CoverageData(".coverage")
d.lines[FILENAME] = {7: None, 8:None, 11:None, 12: None}
d.write()
then coverage report
ran from .
where both .coverage
and source.py
are present, depending on FILENAME
above, observed
source_that_doesnt_exist.py
– complains that source cannot be found, ok/full/path/to/source.py
– no error, coverage 25%, ok./source.py
– no error, coverage 0%, why?source.py
– no error, coverage 0%, why?
It appears that error reporting is not consistent with coverage reporting.
same for coverage html
- Bitbucket: https://bitbucket.org/ned/coveragepy/issue/320
- This issue had attachments: ctest.tgz. See the original issue for details.
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Option to use relative file paths in .coverage file #597 - GitHub
I test my project in a Docker container and then examine covered lines in PyCharm on my host machine. Currently PyCharm can only...
Read more >IOS project code coverage source file is relative path
Hi,Jasper. I use lcov tool to generate html report with .gcda and .gcno files together,but I found the report missed a lot of...
Read more >tools/code_coverage/coverage.py - chromium/src.git
Returns: A relative path to the generated profdata file. """ _BuildTargets(targets, jobs_count).
Read more >Configuration reference — Coverage.py 6.4.4 documentation
The first value must be an actual file path on the machine where the reporting will happen, so that source code can be...
Read more >D23922 [llvm-cov] Use the native path in the coverage report.
The coverage reports contain the source or binary file paths. On Windows, the file path might contain the separators of both '/' and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Feel free to re-open this if you can provide more information.
@nedbat I can’t even consistently reproduce it myself tbh, it just happens from time to time. Deleting all the cache files (basically everything except the actual source code files) seems fix it though. structure is: