Closed cytrinox closed 5 years ago
It is not possible with the current version of green (2.10.0), though it sounds like a straightforward and useful feature to add.
I haven't tried, but you could probably use a configuration file to configure the coverage
module !
+1 for passing options to the coverage module. Happy to look into it, but I haven't yet looked into the last thing I wanted to look at for this library!
The tricky thing is that green is using coverage as a library and calling things internally, so coverage isn't doing any option parsing for us. On top of that, coverage itself uses subcommands, and each subcommand has different options.
If the part of coverage we call reaches out and looks at config files, then that's an excellent option!
If not, then perhaps we could devise some syntax for giving green the desired options for coverage subcommands and then green could try to hook into coverage's parsing code.
https://coverage.readthedocs.io/en/v4.5.x/api_coverage.html#coverage.Coverage.__init__ specifically the config argument if this was exposed in options that'd be great. Having to specify in multiple locations coverage options seems odd.
@jrabbit That's a good suggestion. Having the ability to direct coverage to a config file could cover all future (and existing) coverage options, and Green wouldn't have to maintain some custom parsing of said options.
Included in 2.16.0 (just released) as -g/--cov-config-file
The coverage module provides important command line options like -a:
For full coverage, I need to run green/coverage multiple times with different environment options. Is it possible to accumulate multiple runs / pass the -a option via green?