Use pytestconfig instead of request.config in cache example (#11542)
to be consistent with the API documentation.
This commit is contained in:
parent
bcd9664370
commit
38f7c1e346
|
@ -0,0 +1,3 @@
|
|||
Use pytestconfig instead of request.config in cache example
|
||||
|
||||
to be consistent with the API documentation.
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue