CoverageScript.command_line wipes out 1st sys.path entry.
See original GitHub issueThis can be problematic if the coverage distribution itself is not the first item on the classpath: https://github.com/nedbat/coveragepy/blob/401471c1c51c2a99b31b0508578d04b4da03eebb/coverage/cmdline.py#L468-L470
Is there any reason this couldn’t be a sys.path.insert(0, '')
?
I’m happy to do the work but I just wanted to run this by you first.
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (12 by maintainers)
Top Results From Across the Web
Change history for coverage.py - Read the Docs
The coverage run command has always adjusted the first entry in sys.path, to properly emulate how Python runs your program. Now this adjustment...
Read more >25.1. sys — System-specific parameters and functions
This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It...
Read more >dotnet-coverage code coverage tool - .NET CLI - Microsoft Learn
Removes all input coverage reports that were merged. -r, --recursive ... coverage data. <args>. The command line arguments for the command.
Read more >28.1. sys — System-specific parameters and functions
The list of command line arguments passed to a Python script. ... This function prints out a given traceback and exception to sys.stderr....
Read more >optparse — Parser for command line options — Python 3.11.1 ...
and optparse will print out a brief summary of your script's options: ... In Python, arguments are elements of sys.argv[1:] ( sys.argv[0] is...
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
Fixed in https://github.com/nedbat/coveragepy/commit/e82d24da2355df86fc46d7d41142ce308ed2c919.
This is re-fixed in commit b7e0eec3d794ee350f8a4392a0c9cc90fff54fa0, released as part of 5.0a4.