Skip to content

Commit

Permalink
Merge pull request #12154 from bluetech/fixtures-cache-key-idx
Browse files Browse the repository at this point in the history
fixtures: stop using `request.param_index` in fixture cache key
  • Loading branch information
bluetech authored Mar 24, 2024
2 parents c650e3a + 3eb16b3 commit cfc4cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ def execute(self, request: SubRequest) -> FixtureValue:
return result

def cache_key(self, request: SubRequest) -> object:
return request.param_index if not hasattr(request, "param") else request.param
return getattr(request, "param", None)

def __repr__(self) -> str:
return f"<FixtureDef argname={self.argname!r} scope={self.scope!r} baseid={self.baseid!r}>"
Expand Down

0 comments on commit cfc4cf0

Please sign in to comment.