Skip to content

Commit 12e0ab8

Browse files
thervejirikuncar
andauthored
Handle error in getfixturevalue (#752)
If we don't ignore the error when getfixturevalue, the proper error doesn't bubble up and we get a weird "recursive dependency" error. Co-authored-by: Jiri Kuncar <[email protected]>
1 parent 0a64c97 commit 12e0ab8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ def pytest_bdd_before_scenario(request, feature, scenario):
122122

123123

124124
def pytest_bdd_after_scenario(request, feature, scenario):
125-
ctx = request.getfixturevalue("context")
125+
try:
126+
ctx = request.getfixturevalue("context")
127+
except Exception:
128+
return
126129
for undo in reversed(ctx["undo_operations"]):
127130
undo()
128131

0 commit comments

Comments
 (0)