Fix session-scoped fixtures example in README
This commit is contained in:
@@ -126,7 +126,7 @@ Here is the code:
|
|||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def session_data(tmp_path_factory, worker_id):
|
def session_data(tmp_path_factory, worker_id):
|
||||||
if not worker_id:
|
if worker_id == "master":
|
||||||
# not executing in with multiple workers, just produce the data and let
|
# not executing in with multiple workers, just produce the data and let
|
||||||
# pytest's fixture caching do its job
|
# pytest's fixture caching do its job
|
||||||
return produce_expensive_data()
|
return produce_expensive_data()
|
||||||
|
|||||||
Reference in New Issue
Block a user