Chapter 4
■
nose and nose2
70
nosetests
You can also invoke this process in verbose mode:
nosetests -v
The output is as follows:
test.test_module01.test_case01 ... ok
test.test_module02.TestClass01.test_case01 ... ok
Ran 2 tests in 0.328s
OK
As
you can see in the output, nosetests automatically discovers
the test package and
runs all its test modules.
Fixtures
for Classes, Modules, and
Methods
nose provides xUnit-style fixtures that behave in similar way as the fixtures in unittest.
Even the names of the fixtures are same. Consider
the code in Listing
4-4
.
Do'stlaringiz bilan baham: