From 38f7c1e3469369bfdad2a6b1019578c3e0522501 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Mon, 23 Oct 2023 20:45:16 +0200 Subject: [PATCH] Use pytestconfig instead of request.config in cache example (#11542) to be consistent with the API documentation. --- changelog/11065.doc.rst | 3 +++ doc/en/how-to/cache.rst | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelog/11065.doc.rst diff --git a/changelog/11065.doc.rst b/changelog/11065.doc.rst new file mode 100644 index 000000000..70a3db92c --- /dev/null +++ b/changelog/11065.doc.rst @@ -0,0 +1,3 @@ +Use pytestconfig instead of request.config in cache example + +to be consistent with the API documentation. diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index 03ab0c777..1b2a454cc 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -213,12 +213,12 @@ across pytest invocations: @pytest.fixture - def mydata(request): - val = request.config.cache.get("example/value", None) + def mydata(pytestconfig): + val = pytestconfig.cache.get("example/value", None) if val is None: expensive_computation() val = 42 - request.config.cache.set("example/value", val) + pytestconfig.cache.set("example/value", val) return val