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

Method test_params_and_ids

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

Source from the content-addressed store, hash-verified

3138 reprec.assertoutcome(passed=1)
3139
3140 def test_params_and_ids(self, pytester: Pytester) -> None:
3141 pytester.makepyfile(
3142 """
3143 import pytest
3144
3145 @pytest.fixture(params=[object(), object()],
3146 ids=['alpha', 'beta'])
3147 def fix(request):
3148 return request.param
3149
3150 def test_foo(fix):
3151 assert 1
3152 """
3153 )
3154 res = pytester.runpytest("-v")
3155 res.stdout.fnmatch_lines(["*test_foo*alpha*", "*test_foo*beta*"])
3156
3157 def test_params_and_ids_yieldfixture(self, pytester: Pytester) -> None:
3158 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected