Type hints document what a function expects and let editors catch mistakes. pytest runs every function that starts with test_ and reports what failed.
# prices.py def with_vat(price: float, rate: float = 0.081) -> float: return round(price * (1 + rate), 2) # test_prices.py from prices import with_vat def test_with_vat(): assert with_vat(100) == 108.1 pip install pytest pytest