Skip to content

Fix SA dialect suite collapse under pytest 9 --strict-markers#13

Merged
ShawnChen-Sirius merged 1 commit into
mainfrom
fix/sa-suite-pytest9-strict-markers
Jun 17, 2026
Merged

Fix SA dialect suite collapse under pytest 9 --strict-markers#13
ShawnChen-Sirius merged 1 commit into
mainfrom
fix/sa-suite-pytest9-strict-markers

Conversation

@ShawnChen-Sirius

Copy link
Copy Markdown
Collaborator

Summary

Scheduled CI on main has been failing every day since 2026-06-08 with:

INTERNALERROR> Failed: 'mypy' not found in `markers` configuration option

(See e.g. run 27606145536.)

Root cause

SQLAlchemy's testing plugin registers a handful of pytest markers dynamically:

  • At import time via config.add_to_marker.<name>: mypy, memory_intensive, timing_intensive
  • During collection via test_class.add_marker(...): backend, sparse_backend, sparse_driver_backend

pytest 9.x tightened --strict-markers so these lookups now fail() before SA's session-start hook can register the markers itself, aborting the whole sa_suite session at collection.

The repo opts into --strict-markers globally via pyproject.toml addopts — intentional, it catches typos in our own markers — and the sa_suite job inherits the flag. Dropping --strict-markers globally would lose that safety net on the rest of the tree.

Fix

Pre-register the SA-internal markers in tests/sa_suite/conftest.py so the lookup succeeds. Scoped to the sa_suite directory; no effect on the unit / contract / fuzz / perf / integration / differential jobs.

Test plan

  • Reproduced locally with pytest 9.1.0 + SQLAlchemy 2.0.51 + chdb 4.1.9 (same versions as CI)
  • sa_suite: 595 passed, 673 skipped (skip count matches the pre-regression baseline)
  • pytest -ra -m "not integration and not differential and not perf and not fuzz": 314 passed
  • CI green on this PR

Generated with Claude Code
via Happy

The scheduled CI on main has been failing every day since 2026-06-08 with:

    INTERNALERROR> Failed: 'mypy' not found in `markers` configuration option

Root cause: SQLAlchemy's testing plugin registers a handful of pytest
markers dynamically — some at import time via
``config.add_to_marker.<name>`` (mypy, memory_intensive, timing_intensive),
others during collection via ``test_class.add_marker(...)`` (backend,
sparse_backend, sparse_driver_backend). pytest 9.x tightened
``--strict-markers`` so that these lookups now fail before SA's
session-start hook can register the markers itself, aborting the whole
sa_suite session at collection.

The repo opts into ``--strict-markers`` globally via
``pyproject.toml`` addopts (intentional — it catches typos in our own
markers), and that flag is inherited by the sa_suite job's pytest
invocation. We can't just drop it without losing the safety net on the
rest of the tree.

Fix: pre-register the SA-internal markers in ``tests/sa_suite/conftest.py``
so the lookup succeeds. The change is scoped to the sa_suite directory
and has no effect on the unit / contract / fuzz / perf / integration /
differential jobs.

Verified locally with pytest 9.1.0 + SQLAlchemy 2.0.51 + chdb 4.1.9
(matching the CI environment): 595 passed, 673 skipped — same skip count
as the pre-regression baseline.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@ShawnChen-Sirius ShawnChen-Sirius merged commit 2bc1ddf into main Jun 17, 2026
14 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