test

Why I use tests

Nose

write some tests, then use nose

$ pip install nose
$ nosetests -v

Pytest

$ pip install pytest
$ py.test -v path/to/test/dir

可以使用插件,比如说覆盖度和 pep8 检查

$ pip install pytest-cove pytest-pep8
$ py.test -v --pep8 --cov=path/to/test/dir path/to/test/dir

Reference