provide error fixture applied to the same func
provide error fixture applied to the same func provide error fixture applied to the same func
This commit is contained in:
parent
9b51fc646c
commit
cfd16d0dac
|
@ -827,6 +827,10 @@ class FixtureFunctionMarker:
|
||||||
if isclass(function):
|
if isclass(function):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"class fixtures not supported (may be in the future)")
|
"class fixtures not supported (may be in the future)")
|
||||||
|
if getattr(function, "_pytestfixturefunction", False):
|
||||||
|
raise ValueError(
|
||||||
|
"fixture is being applied more than once to the same function")
|
||||||
|
|
||||||
function._pytestfixturefunction = self
|
function._pytestfixturefunction = self
|
||||||
return function
|
return function
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Now when @pytest.fixture is being applied to the same function ValueError is raised.
|
Loading…
Reference in New Issue