Pytest parameters



examples/pytest/test_mymath_parameters.py
import mymath
import pytest

@pytest.mark.parametrize("a,b,result", [
    (2, 3, 5),
    (-1, 1, 0),
])
def test_add(a, b, result):
    assert mymath.add(a, b)  == result


def test_div():
    assert mymath.div(6, 3)  == 2
    assert mymath.div(42, 1) == 42