Show proper error when 'request' is used as a parameter name in parametrize (#6183)
(self, pytester: Pytester)
| 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)""" |
| 184 | |
| 185 | def func(request): |
| 186 | raise NotImplementedError() |
| 187 | |
| 188 | metafunc = self.Metafunc(func) |
| 189 | with pytest.raises( |
| 190 | fail.Exception, |
| 191 | match=r"'request' is a reserved name and cannot be used in @pytest.mark.parametrize", |
| 192 | ): |
| 193 | metafunc.parametrize("request", [1]) |
| 194 | |
| 195 | def test_find_parametrized_scope(self) -> None: |
| 196 | """Unit test for _find_parametrized_scope (#3941).""" |
nothing calls this directly
no test coverage detected