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.
Original comment byBrandon 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.