10000 Circumvent Codecov's legitimate complaint without resorting to pragma… · ericpre/zarr-python@acf6828 · GitHub
[go: up one dir, main page]

Skip to content

Commit acf6828

Browse files
Circumvent Codecov's legitimate complaint without resorting to pragma (zarr-developers#823)
* Circumvent Codecov's legitimate complaint Codecov recognises that we aren't testing with fsspec. Perhaps it is less picky if we use pytest.param to parametrise the tests. * Add a release note * Correct typo
1 parent 4b03dfe commit acf6828

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

docs/release.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Release notes
66
Unreleased
77
----------
88

9+
Maintenance
10+
~~~~~~~~~~~
11+
12+
* Mark the fact that some tests that require ``fsspec``, without compromising the code coverage score.
13+
By :user:`Ben Williams <benjaminhwilliams>`; :issue:`823`.
14+
915
.. _release_2.9.2:
1016

1117
2.9.2

zarr/tests/test_dim_separator.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
from zarr.tests.util import have_fsspec
1010

1111

12+
needs_fsspec = pytest.mark.skipif(not have_fsspec, reason="needs fsspec")
13+
14+
1215
@pytest.fixture(params=("static_nested",
1316
"static_flat",
1417
"directory_nested",
1518
"directory_flat",
1619
"directory_default",
1720
"nesteddirectory_nested",
1821
"nesteddirectory_default",
19-
"fs_nested",
20-
"fs_flat",
21-
"fs_default"))
22+
pytest.param("fs_nested", marks=needs_fsspec),
23+
pytest.param("fs_flat", marks=needs_fsspec),
24+
pytest.param("fs_default", marks=needs_fsspec)))
2225
def dataset(tmpdir, request):
2326
"""
2427
Generate a variety of different Zarrs using
@@ -42,8 +45,6 @@ def dataset(tmpdir, request):
4245
elif which.startswith("nested"):
4346
store_class = NestedDirectoryStore
4447
else:
45-
if have_fsspec is False:
46-
pytest.skip("no fsspec") # pragma: no cover
4748
store_class = FSStore
4849
kwargs["mode"] = "w"
4950
kwargs["auto_mkdir"] = True
@@ -66,7 +67,7 @@ def test_open(dataset):
6667
verify(zarr.open(dataset, "r"))
6768

6869

69-
@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec")
70+
@needs_fsspec
7071
def test_fsstore(dataset):
7172
verify(Array(store=FSStore(dataset)))
7273

0 commit comments

Comments
 (0)
0