You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Pranav Sharma <pr...@gmail.com> on 2016/01/15 17:38:08 UTC
nosetests
Is there a way to identify a test? And is there a way to run those specific
tests only?
Running them all takes a lot of time, just to see an error in a particular
test.
Re: nosetests
Posted by Dave Brondsema <da...@brondsema.net>.
On 1/15/16 11:38 AM, Pranav Sharma wrote:
> Is there a way to identify a test? And is there a way to run those specific
> tests only?
>
> Running them all takes a lot of time, just to see an error in a particular
> test.
>
Yes, pretty much anything that starts with "Test" or "test_" is a test. To run
just some, you can specify a single filename like `nosetests foo/bar/baz.py` or
a reference to a particular package, class, or function like `nosetests
forgewiki.tests.functional.test_rest:TestWikiApi.test_get_page` Docs at
http://nose.readthedocs.org/en/latest/usage.html#selecting-tests
One unfortunate thing is that when a test fails, the name displayed is not the
same format, so you can't copy & paste it to re-run a test. I have the
nose-progressive plugin install and then if you run --with-progressive it will
change the output in a number of ways including formatting the test names
correctly, so you can copy & paste them to re-run easily.
--
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
<><