MCPcopy
hub / github.com/pytest-dev/pytest / test_parametrize_bad_scope

Method test_parametrize_bad_scope

testing/python/metafunc.py:171–180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

169 metafunc.parametrize("x", [1, 2, 3], ids=gen())
170
171 def test_parametrize_bad_scope(self) -> None:
172 def func(x):
173 pass
174
175 metafunc = self.Metafunc(func)
176 with pytest.raises(
177 fail.Exception,
178 match=r"parametrize\(\) call in func got an unexpected scope value 'doggy'",
179 ):
180 metafunc.parametrize("x", [1], scope="doggy") # type: ignore[arg-type]
181
182 def test_parametrize_request_name(self, pytester: Pytester) -> None:
183 """Show proper error when 'request' is used as a parameter name in parametrize (#6183)"""

Callers

nothing calls this directly

Calls 2

MetafuncMethod · 0.95
parametrizeMethod · 0.95

Tested by

no test coverage detected