Skip to content

test: pass a list, not a generator, to parametrize in test_docs#4138

Merged
d-v-b merged 16 commits into
zarr-developers:mainfrom
d-v-b:claude/test-pytest-911
Jul 9, 2026
Merged

test: pass a list, not a generator, to parametrize in test_docs#4138
d-v-b merged 16 commits into
zarr-developers:mainfrom
d-v-b:claude/test-pytest-911

Conversation

@d-v-b

@d-v-b d-v-b commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

What

tests/test_docs.py::test_docstrings passes the find_examples(...) generator directly to @pytest.mark.parametrize. Materialize it to a list, matching the existing list(find_examples(...)) usage a few lines up in the same module.

-@pytest.mark.parametrize("example", find_examples(str(SOURCES_ROOT)), ids=str)
+@pytest.mark.parametrize("example", list(find_examples(str(SOURCES_ROOT))), ids=str)

Why

pytest 9.1 deprecated passing a non-Collection iterable (e.g. a generator) to parametrize, emitting PytestRemovedIn10Warning. Because this repo sets filterwarnings = ["error"], that deprecation is promoted to a hard error at collection time:

ERROR collecting tests/test_docs.py
E   pytest.PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
E   Test: tests/test_docs.py::test_docstrings, argvalues type: generator
Interrupted: 1 error during collection

This is the sole blocker for the pytest 9.0.3 → 9.1.1 bump in the python-dependencies group update (#4137): in that run every job passes except doctests, which is the only env that installs pytest-examples and therefore actually collects this module (every other env skips it via importorskip).

Verification

Under pytest==9.1.1 with pytest-examples installed:

  • before: no tests collected, 1 error in 0.11s (reproduces the CI failure)
  • after: 60 tests collected, no error

🤖 Generated with Claude Code

dependabot Bot and others added 15 commits May 31, 2026 19:28
…#176)

Bumps the actions group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) | `0.9.5` | `0.9.6` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `6.0.0` | `6.0.1` |
| [github/issue-metrics](https://github.com/github/issue-metrics) | `4.2.2` | `4.2.7` |
| [j178/prek-action](https://github.com/j178/prek-action) | `2.0.3` | `2.0.4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.1` |
| [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.0` |
| [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.3` | `0.5.6` |



Updates `prefix-dev/setup-pixi` from 0.9.5 to 0.9.6
- [Release notes](https://github.com/prefix-dev/setup-pixi/releases)
- [Commits](prefix-dev/setup-pixi@1b2de7f...5185adf)

Updates `codecov/codecov-action` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@57e3a13...e79a696)

Updates `github/issue-metrics` from 4.2.2 to 4.2.7
- [Release notes](https://github.com/github/issue-metrics/releases)
- [Commits](github-community-projects/issue-metrics@c9e9838...1e38d5e)

Updates `j178/prek-action` from 2.0.3 to 2.0.4
- [Release notes](https://github.com/j178/prek-action/releases)
- [Commits](j178/prek-action@6ad8027...bdca6f1)

Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v7...043fb46)

Updates `actions/download-artifact` from 7.0.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v7...3e5f45b)

Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.13.0...cef2210)

Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.6
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](zizmorcore/zizmor-action@b1d7e1f...5f14fd0)

---
updated-dependencies:
- dependency-name: prefix-dev/setup-pixi
  dependency-version: 0.9.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: github/issue-metrics
  dependency-version: 4.2.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: j178/prek-action
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
pytest 9.1 deprecated passing a non-Collection iterable to
@pytest.mark.parametrize (PytestRemovedIn10Warning). find_examples()
returns a generator, and with filterwarnings=error that deprecation
becomes a hard collection error, breaking the doctests env under
pytest 9.1.1 (e.g. the zarr-developers#4137 dependency bump). Materialize it to a
list, matching the existing list(find_examples(...)) usage elsewhere
in this module.

Assisted-by: ClaudeCode:claude-opus-4-8
@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jul 9, 2026
@d-v-b

d-v-b commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

merging this as soon as tests pass

Assisted-by: ClaudeCode:claude-opus-4-8
@github-actions github-actions Bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Jul 9, 2026
@d-v-b d-v-b merged commit 9bc5b0a into zarr-developers:main Jul 9, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant