Merge remote-tracking branch 'origin/master' into mm

This commit is contained in:
Anthony Sottile
2019-11-15 15:26:57 -08:00
16 changed files with 143 additions and 28 deletions

View File

@@ -72,6 +72,19 @@ class TestMetafunc:
):
metafunc.parametrize("x", [1], scope="doggy")
def test_parametrize_request_name(self, testdir):
"""Show proper error when 'request' is used as a parameter name in parametrize (#6183)"""
def func(request):
raise NotImplementedError()
metafunc = self.Metafunc(func)
with pytest.raises(
pytest.fail.Exception,
match=r"'request' is a reserved name and cannot be used in @pytest.mark.parametrize",
):
metafunc.parametrize("request", [1])
def test_find_parametrized_scope(self):
"""unittest for _find_parametrized_scope (#3941)"""
from _pytest.python import _find_parametrized_scope