Table of Contents
Why I use tests
- you code can work.
- make sure that when you change you code, you won't break it.
- think more than usual.
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