Packages that should be included

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

autopep8

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

Packages that should be included
List packages that can be updated with pip
33 strings that should not be used as variable names in python
Install packages that need to be compiled with Python3 with pip [Windows]
Confirmation that rkhunter can be installed
5 languages that every developer should learn
[python] Script that (should) update pwsh