Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nose: How to skip tests by default?

I am using Python's nose and I have marked some of my tests as "slow", as explained in the attrib plugin documentation.

I would like to skip all "slow" Tests by default when running nosetests, i.e. without having to write nosetests -a '!slow'. But I want to be able to run these tests when explicitly running them or writing nosetests -a 'slow'.

How can I achieve this?

like image 566
André Avatar asked Feb 03 '13 16:02

André


People also ask

Which command is used to run nose tests?

nose can be integrated with DocTest by using with-doctest option in athe bove command line. The result will be true if the test run is successful, or false if it fails or raises an uncaught exception. nose supports fixtures (setup and teardown methods) at the package, module, class, and test level.


1 Answers

"Options are the same as on the command line, with the -- prefix removed" (https://nose.readthedocs.org/en/latest/usage.html#configuration)

A file setup.cfg with the following contents should work:

[nosetests]
attr=!speed=slow
like image 61
t-8ch Avatar answered Oct 05 '22 23:10

t-8ch