MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_parametrize

Method test_parametrize

testing/python/fixtures.py:2191–2206  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

2189
2190class TestFixtureMarker:
2191 def test_parametrize(self, pytester: Pytester) -> None:
2192 pytester.makepyfile(
2193 """
2194 import pytest
2195 @pytest.fixture(params=["a", "b", "c"])
2196 def arg(request):
2197 return request.param
2198 values = []
2199 def test_param(arg):
2200 values.append(arg)
2201 def test_result():
2202 assert values == list("abc")
2203 """
2204 )
2205 reprec = pytester.inline_run()
2206 reprec.assertoutcome(passed=4)
2207
2208 def test_multiple_parametrization_issue_736(self, pytester: Pytester) -> None:
2209 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected