April 2019
Intermediate to advanced
646 pages
16h 48m
English
nose goes a step further when executing tests compared to unittest by running all classes and functions whose name matches the regular expression ((?:^|[b_.-])[Tt]est). It searches for test units in modules whose names match the same expression. Roughly, all callables that start with test and are located in a module that match that pattern will also be executed as a test.
For instance, this test_ok.py module will be recognized and run by nose:
$ cat test_ok.py
def test_ok():
print('my test')
$ nosetests -v
test_ok.test_ok ... ok
----------------------------------------------------------
Ran 1 test in 0.071s
OK
Regular TestCase classes and doctests are executed as well.
Last but not least, nose provides assertion functions that ...
Read now
Unlock full access