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

run subcommand should take a module name #95

Closed
nedbat opened this issue Nov 2, 2010 · 4 comments
Closed

run subcommand should take a module name #95

nedbat opened this issue Nov 2, 2010 · 4 comments
Labels
enhancement New feature or request run

Comments

@nedbat
Copy link
Owner

nedbat commented Nov 2, 2010

Originally reported by Anonymous


A la python -m switch, it'd be helpful to pass a the name of a module to cover, instead of just a file.

The use case here is integration with unittest's test discovery. As of 2.7 can do python -m unittest discover and it will find your tests. There's no way AFAICT to simulate this correctly - trying to pass '/usr/lib/python2.7/unittest/init.py' as run's argument messes up import paths.

Currently, I wrote a little stub that just calls unittest's main(), but figuring this out how to do this was slightly annoying.


@nedbat
Copy link
Owner Author

nedbat commented Nov 4, 2010

Original comment by Peter Fein (Bitbucket: pfein, GitHub: pfein)


Oops, wasn't logged in when I posted this... pfein@pobox.com

@nedbat
Copy link
Owner Author

nedbat commented Feb 3, 2011

Original comment by Brandon Rhodes (Bitbucket: brandon, GitHub: brandon)


A patch that provides a "-m" option is now ready at https://bitbucket.org/brandon/coverage.py if anyone watching this issue wants to try it out! I have issued a pull request, so Ned should be looking at it when he gets a chance.

@nedbat
Copy link
Owner Author

nedbat commented Feb 7, 2011

Finished in <<changeset 99468f10e88e (bb)>>.

@nedbat
Copy link
Owner Author

nedbat commented Jan 25, 2014

Original comment by Carl Gieringer (Bitbucket: carlgieringer, GitHub: carlgieringer)


Thank you.

@nedbat nedbat closed this as completed Jan 25, 2014
@nedbat nedbat added major enhancement New feature or request run labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request run
Projects
None yet
Development

No branches or pull requests

1 participant