Testing¶
Running the tests are as simple as:
$ python setup.py test
The code coverage can be output by passing some arguments to py.test.
$ python setup.py test -a "tests --cov kwalitee --cov-config .coveragerc"
# html report
$ python setup.py test -a "tests --cov kwalitee --cov-report html"
Ditto for running only one test or debugging with pdb.
$ python setup.py test -a tests/tests_ping.py
$ python setup.py test -a tests/tests_ping.py::test_ping
$ python setup.py test -a "tests --pdb"
Writing tests¶
The tests are using PyHamcrest for its richness and the nice default output
provided. To be consistent, avoid using unittest
or bare assert
.
Fixtures¶
Fixtures are provided by the very powerful py.test. Take a look at the fixtures defined in the conftest.py files.