Skip to content

Commit d2aa307

Browse files
Apply ruff/flake8-pytest-style rule PT003
PT003 `scope='function'` is implied in `@pytest.fixture()`
1 parent aa53081 commit d2aa307

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

xarray/tests/test_distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def test_dask_distributed_read_netcdf_integration_test(
220220
# fixture vendored from dask
221221
# heads-up, this is using quite private zarr API
222222
# https://github.com/dask/dask/blob/e04734b4d8959ba259801f2e2a490cb4ee8d891f/dask/tests/test_distributed.py#L338-L358
223-
@pytest.fixture(scope="function")
223+
@pytest.fixture
224224
def zarr(client):
225225
zarr_lib = pytest.importorskip("zarr")
226226
# Zarr-Python 3 lazily allocates a dedicated thread/IO loop

xarray/tests/test_formatting_html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def childfree_tree(self, childfree_tree_factory):
231231
"""
232232
return childfree_tree_factory()
233233

234-
@pytest.fixture(scope="function")
234+
@pytest.fixture
235235
def mock_datatree_node_repr(self, monkeypatch):
236236
"""
237237
Apply mocking for datatree_node_repr.
@@ -245,7 +245,7 @@ def mock(group_title, dt):
245245

246246
monkeypatch.setattr(fh, "datatree_node_repr", mock)
247247

248-
@pytest.fixture(scope="function")
248+
@pytest.fixture
249249
def mock_wrap_datatree_repr(self, monkeypatch):
250250
"""
251251
Apply mocking for _wrap_datatree_repr.

xarray/tests/test_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def figure_context(*args, **kwargs):
6666
plt.close("all")
6767

6868

69-
@pytest.fixture(scope="function", autouse=True)
69+
@pytest.fixture(autouse=True)
7070
def test_all_figures_closed():
7171
"""meta-test to ensure all figures are closed at the end of a test
7272

0 commit comments

Comments
 (0)