Skip to main content

← All terms · Testing

Parametrize

Run the same test against multiple inputs: `@pytest.mark.parametrize("x,y", [(1,2), (3,4)])`. Replaces copy-paste tests.

Learn this interactively:

Open lesson lesson-142

Related — Testing

pytestDe facto Python test framework. `def test_x():` and `assert` — that's the whole FixtureReusable test setup. Declared with `@pytest.fixture`, injected by parameter nameCoverageMeasures which lines your tests execute. 100% is rarely the goal — 'every import