diff --git a/changes/+c563f4d4.bugfix.rst b/changes/+c563f4d4.bugfix.rst new file mode 100644 index 0000000000..6f9fedaa46 --- /dev/null +++ b/changes/+c563f4d4.bugfix.rst @@ -0,0 +1 @@ +Register 'gpu' marker with pytest for downstream StoreTests. diff --git a/pyproject.toml b/pyproject.toml index 85517d8d0a..102ee76df6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -138,6 +138,7 @@ exclude_lines = [ [tool.coverage.run] omit = [ "bench/compress_normal.py", + "src/zarr/testing/conftest.py", # only for downstream projects ] [tool.hatch] @@ -455,3 +456,6 @@ issue_format = ":issue:`{issue}`" [tool.codespell] ignore-words-list = "astroid" + +[project.entry-points.pytest11] +zarr = "zarr.testing" diff --git a/src/zarr/testing/conftest.py b/src/zarr/testing/conftest.py new file mode 100644 index 0000000000..59c148e0ec --- /dev/null +++ b/src/zarr/testing/conftest.py @@ -0,0 +1,9 @@ +import pytest + + +def pytest_configure(config: pytest.Config) -> None: + # The tests in zarr.testing are intended to be run by downstream projects. + # To allow those downstream projects to run with `--strict-markers`, we need + # to register an entry point with pytest11 and register our "plugin" with it, + # which just registers the markers used in zarr.testing + config.addinivalue_line("markers", "gpu: mark a test as requiring CuPy and GPU")