Skip to content

fix(tests): repair CI test collection on Python 3.9 and 3.13#8

Merged
musharna merged 1 commit into
mainfrom
worktree-ghostcite-ci-fix
Jun 23, 2026
Merged

fix(tests): repair CI test collection on Python 3.9 and 3.13#8
musharna merged 1 commit into
mainfrom
worktree-ghostcite-ci-fix

Conversation

@musharna

Copy link
Copy Markdown
Owner

The version-matrix CI job has been red on main since 06-20 (the scheduled Live tests job was unaffected). Two independent test-collection bugs:

  • Py 3.9tests/test_preprint.py & tests/test_venue.py used list[str] | None / str | None in function default-arg annotations. 3.9 evaluates these at definition time → TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'. Fixed with from __future__ import annotations (keeps the repo's stated 3.9 support).
  • Py 3.13tests/test_cli_semantic.py:144 does from tests.test_cli import FakeClient, but tests/ wasn't an importable package → ModuleNotFoundError: No module named 'tests'. Fixed by adding an empty tests/__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

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
@musharna musharna merged commit 423bc93 into main Jun 23, 2026
8 checks passed
@musharna musharna deleted the worktree-ghostcite-ci-fix branch June 23, 2026 00:57
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