fixtures: stop using `request.param_index` in fixture cache key
When `param` is not defined, `param_index` is always 0 (see `_compute_fixture_value`), so no point in using it besides adding some confusion.
This commit is contained in:
parent
c650e3a94f
commit
3eb16b34be
|
@ -1072,7 +1072,7 @@ class FixtureDef(Generic[FixtureValue]):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def cache_key(self, request: SubRequest) -> object:
|
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:
|
def __repr__(self) -> str:
|
||||||
return f"<FixtureDef argname={self.argname!r} scope={self.scope!r} baseid={self.baseid!r}>"
|
return f"<FixtureDef argname={self.argname!r} scope={self.scope!r} baseid={self.baseid!r}>"
|
||||||
|
|
Loading…
Reference in New Issue