fix(tests): repair CI test collection on Python 3.9 and 3.13#8
Merged
Conversation
Two independent matrix breakages (the version `CI` job was red on main since 06-20; `Live tests` was unaffected): - Py3.9: `tests/test_preprint.py` and `tests/test_venue.py` used `list[str] | None` / `str | None` in function default-arg annotations, which 3.9 evaluates at definition time -> TypeError (GenericAlias | None). Add `from __future__ import annotations` so annotations stay strings. - Py3.13: `tests/test_cli_semantic.py` imports `from tests.test_cli import FakeClient`, but `tests/` was not an importable package. Add empty `tests/__init__.py`. Verified: `pytest -m "not live"` passes on 3.9 and 3.13 (290 passed, 2 skipped), ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjKoaVFk7CFQfdkS18TWHm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The version-matrix
CIjob has been red onmainsince 06-20 (the scheduledLive testsjob was unaffected). Two independent test-collection bugs:tests/test_preprint.py&tests/test_venue.pyusedlist[str] | None/str | Nonein function default-arg annotations. 3.9 evaluates these at definition time →TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'. Fixed withfrom __future__ import annotations(keeps the repo's stated 3.9 support).tests/test_cli_semantic.py:144doesfrom tests.test_cli import FakeClient, buttests/wasn't an importable package →ModuleNotFoundError: No module named 'tests'. Fixed by adding an emptytests/__init__.py.Verification:
pytest -m "not live"passes on both 3.9 and 3.13 (290 passed, 2 skipped, 9 deselected), ruff clean.🤖 Generated with Claude Code