Skip to content

Commit aafe1b8

Browse files
committed
provide error fixture applied to the same func
provide error fixture applied to the same func
1 parent 9b51fc6 commit aafe1b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

_pytest/fixtures.py

+4
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ def __call__(self, function):
827827
if isclass(function):
828828
raise ValueError(
829829
"class fixtures not supported (may be in the future)")
830+
if getattr(function, "_pytestfixturefunction", False):
831+
raise ValueError(
832+
"fixture is being applied more than once to the same function")
833+
830834
function._pytestfixturefunction = self
831835
return function
832836

0 commit comments

Comments
 (0)