Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.coveragerc doesn't support configuration of modules to be executed (like behave) #695

Closed
crd opened this issue Aug 17, 2018 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@crd
Copy link

crd commented Aug 17, 2018

Instead of specifying it all on the command line like this:

$ coverage run --omit "config/*,features/steps/*" -m behave features/local/

I would love to have something like this in my .coveragerc file:

[run]
omit = config/*,features/steps/*
module_commandline = behave features/local

Omit works, but there's no way (as far as I can tell) to specify I want to execute behave against the features/local directory in my example.

@nedbat
Copy link
Owner

nedbat commented Oct 9, 2018

I don't understand the advantage of this? You'd still need to run "coverage run" somehow, so why not just leave the command line arguments there?

@nedbat nedbat added the enhancement New feature or request label Oct 9, 2018
@merwok
Copy link

merwok commented Oct 9, 2018

Tools like flake8 or pyflakes support having their settings and arguments in setup.cfg or tox.ini, which lets people run only $ pytest and have the right options always picked up.

@crd
Copy link
Author

crd commented Oct 9, 2018

@nedbat .coveragerc supports some commandline options but not -m -- feels like it would be a natural extension. Do you disagree in general with the idea of having a coverage config file?

@nedbat
Copy link
Owner

nedbat commented Oct 9, 2018

@crd Of course I don't disagree with the idea of having a coverage config file. It's full of all sorts of useful things. I just hadn't personally seen the need for the rest of the "coverage run" command line to be in it, since it wouldn't save me a command line, just shorten it. The config file was originally created as a way to control options when running coverage within a test runner, where I couldn't parse command-line options to control coverage's behavior.

@nedbat
Copy link
Owner

nedbat commented Oct 18, 2018

Implemented in e575490.

@nedbat nedbat closed this as completed Oct 18, 2018
@crd
Copy link
Author

crd commented Nov 17, 2018

Thank you @nedbat, I realize you were iffy on the value of this line in .coveragerc but as someone on the hook for a few dozen prod apps it will be very nice to now be able to clone a project, pipenv sync --dev, followed by pipenv run coverage run

Appreciate it!

@nedbat
Copy link
Owner

nedbat commented Nov 25, 2018

This was released as part of 5.0a4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants