Pytest and mypy
pip install mypy
pip install pytest-mypy
mypy mymod.py
pytest --mypy
import sys
z = "23"
z = int(z)
def add(x, y):
return x + y
import mymod
x = "23"
x = int(x)
def test_add():
assert mymod.add(2, 3) == 5
Excluding files when using mypy
works, but that does not exclude them when using pytest --mypy
{% embed include file="src/examples/pytest/mypy/mypy.ini)
Not even this:
{% embed include file="src/examples/pytest/mypy/pytest.ini)