Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pytest and flake8

flake8 - Style Guide Enforcement

import sys

def add(a):
    return a

def add(x, y):
   z = 42
   sum = x+y
   return sum

print = 42
import mymod

def test_add():
    assert mymod.add(2, 3) == 5

[flake8]
ignore =
#ignore = F401 E302 E111 F841 E111 E226 E111 W391
#exclude = test_mymod.py

pip install flake8
pip install pytest-flake8
pip install flake8-builtins

flake8
rm -rf .pytest_cache/
pytest --flake8