pep8 Coding guidelines.
pip install pep8
do it
pep8 test.py
And so on
test.py:3:1: E302 expected 2 blank lines, found 1
Something comes out.
Because it is impossible to deal with this one by one
pip install autopep8
do it py-autopep8.el Is installed in Emacs, and if you save it, it will be corrected without permission.
py.test When pytest-cov
pip install -U pytest
pip install pytest-cov
py.test --cov target file.py/Directory target TestCase class.py
And coverage will come out
Perfect Python 13-4-3 Mock.patch section execution results
============================ in 0.03 seconds ===========================
Naganos-MacBook-Air:13 nagano$ py.test --cov ./ mocktest.py
============================ test session starts ========================
platform darwin -- Python 3.3.3 -- py-1.4.20 -- pytest-2.5.2
plugins: cov
collected 1 items
mocktest.py .
------ coverage: platform darwin, python 3.3.3-final-0 -------------------
Name Stmts Miss Cover
--------------------------------
mocktest 8 0 100%
mod1 3 1 67%
mod2 6 1 83%
simpletest 12 12 0%
--------------------------------
TOTAL 29 14 52%
============================ 1 passed in 0.09 seconds =====================
Recommended Posts