Skip to content

Commit 38f7c1e

Browse files
Use pytestconfig instead of request.config in cache example (#11542)
to be consistent with the API documentation.
1 parent bcd9664 commit 38f7c1e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

changelog/11065.doc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Use pytestconfig instead of request.config in cache example
2+
3+
to be consistent with the API documentation.

doc/en/how-to/cache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ across pytest invocations:
213213
214214
215215
@pytest.fixture
216-
def mydata(request):
217-
val = request.config.cache.get("example/value", None)
216+
def mydata(pytestconfig):
217+
val = pytestconfig.cache.get("example/value", None)
218218
if val is None:
219219
expensive_computation()
220220
val = 42
221-
request.config.cache.set("example/value", val)
221+
pytestconfig.cache.set("example/value", val)
222222
return val
223223
224224

0 commit comments

Comments
 (0)