[TIP] recommended way to run nose from coverage
ned at nedbatchelder.com
Fri May 27 12:54:07 PDT 2016
"coverage run" is meant to be a replacement for "python". So "python
foo.py" can become "coverage run foo.py", and "python -m foo" can become
"coverage run -m foo". Coverage.py doesn't know how to run commands,
though there is an open ticket requesting that feature.
If you know your command is actually a Python program, you can try:
coverage run `which nosetests`
André has the right answer for nose, since it will run as a module.
On 5/27/16 8:38 AM, André Caron wrote:
> This is how I do it:
> coverage run -m nose ...
> On Fri, May 27, 2016 at 8:29 AM, Chris Withers <chris at simplistix.co.uk
> <mailto:chris at simplistix.co.uk>> wrote:
> On 06/01/2016 18:30, Ned Batchelder wrote:
> FWIW, I strongly prefer using coverage to run nose rather than
> the other
> way around. I guess that's to be expected :) This may be an
> effect of
> the nose coverage plugin somehow.
> How do you do this?
> my naive:
> coverage run nosetests
> ...gives "No file to run: 'noestests"
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> <mailto:testing-in-python at lists.idyll.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python