2. Добавляем к python проекту тесты, покрытие и проверку чистоты кода
Adding tests, coverage and code style checker to python project.
46) .\mytestvenv\Scripts\deactivate
47) cd C:\work\Python\mypython
48) .\myvenv\Scripts\activate
49) in cmd “pip install tox“
49) create file ““ in “C:\work\Python\mypython“
50) add text in ““ file
[tox]
envlist = py38
skipsdist=true
[testenv]
commands = pytest
whitelist_externals = *
51) create folder “tests“ in “C:\work\Python\mypython“
52) add file empty filr ““ in “C:\work\Python\mypython“
53) add file ““ in “C:\work\Python\mypython ests“
54) add code in ““
from import SayHello
def test_SayHello():
assert SayHello(“bb“) == None
55) in cmd “tox“
56) pip install flake8
57) add to ““
[flake8]
application_import_names = myPyLib, tests
max-line-length = 120
extend-ignore = E203,W503,E231,I201
exclude = myvenv, .tox, build, dist
58) in cmd “flake8“
59) pip install pytest-cov
60) pip install pytest-xdist
61) add to ““
[pytest]
addopts = --cov= --