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

Method test_parametrize_bad_scope

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

Source from the content-addressed store, hash-verified

114 metafunc.parametrize("x", [1, 2, 3], ids=gen()) # type: ignore[arg-type]
115
116 def test_parametrize_bad_scope(self) -> None:
117 def func(x):
118 pass
119
120 metafunc = self.Metafunc(func)
121 with pytest.raises(
122 fail.Exception,
123 match=r"parametrize\(\) call in func got an unexpected scope value 'doggy'",
124 ):
125 metafunc.parametrize("x", [1], scope="doggy") # type: ignore[arg-type]
126
127 def test_parametrize_request_name(self, pytester: Pytester) -> None:
128 """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