Show proper error when 'request' is used as a parameter name in parametrize (#6183)
(self, pytester: Pytester)
| 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)""" |
| 129 | |
| 130 | def func(request): |
| 131 | raise NotImplementedError() |
| 132 | |
| 133 | metafunc = self.Metafunc(func) |
| 134 | with pytest.raises( |
| 135 | fail.Exception, |
| 136 | match=r"'request' is a reserved name and cannot be used in @pytest.mark.parametrize", |
| 137 | ): |
| 138 | metafunc.parametrize("request", [1]) |
| 139 | |
| 140 | def test_find_parametrized_scope(self) -> None: |
| 141 | """Unit test for _find_parametrized_scope (#3941).""" |
nothing calls this directly
no test coverage detected