Skip to content

test: Fix test failures with pytest 9.2.0 - #833

Merged
ValerianRey merged 2 commits into
mainfrom
disable-dash-pytest-plugin
Oct 28, 2026
Merged

ValerianRey merged 2 commits into
mainfrom
disable-dash-pytest-plugin

Conversation

@ValerianRey

@ValerianRey ValerianRey commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

pytest 9.2.0 (released 2026-10-27) breaks our tests in two independent ways. This PR fixes both.

1. dash plugin fails with `-W error`

```
Error while loading plugin "pytest11".
pytest.PytestRemovedIn10Warning: The hookimpl pytest_addhooks uses old-style configuration options (marks or attributes).
```

dash (from the `plot` group) registers a pytest plugin that configures a hook with the deprecated `@pytest.mark.tryfirst` (plotly/dash#2420). pytest 9.2.0 now applies warning filters while loading entry-point plugins, so `-W error` turns this into a startup failure.

Fix: `addopts = "-p no:dash"` in the pytest config. We don't use that plugin, and the option has no effect when dash isn't installed.

2. Crash on Python 3.10.0 (lower-bounds job)

```
INTERNALERROR> AttributeError: 'NodeId' object has no attribute '_str_cache'
```

pytest 9.2.0's new `NodeId` dataclass uses `slots=True` with an `init=False` field that has a default. CPython 3.10.0 never initializes such fields (bpo-44649, fixed in 3.10.1).

Fix: run the lower-bounds job on Python 3.10.2. 3.10.1 isn't available through uv. `requires-python` stays at `>=3.10`, since TorchJD itself is unaffected.

🤖 Generated with Claude Code

pytest 9.2.0 applies warning filters while loading entry-point plugins, so
dash's deprecated hook marks make pytest -W error fail at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ValerianRey ValerianRey added the cc: test Conventional commit type for changes to tests. label Oct 28, 2026
@github-actions github-actions Bot changed the title Disable dash pytest plugin test: Disable dash pytest plugin Oct 28, 2026
@ValerianRey
ValerianRey marked this pull request as ready for review October 28, 2026 08:59
@ValerianRey
ValerianRey requested a review from a team as a code owner October 28, 2026 08:59
Python 3.10.0 has a dataclass bug (bpo-44649) that makes pytest 9.2.0 crash
at startup. 3.10.1 is not provided by uv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ValerianRey ValerianRey changed the title test: Disable dash pytest plugin Fix test failures with pytest 9.2.0 Oct 28, 2026
@github-actions github-actions Bot changed the title Fix test failures with pytest 9.2.0 test: Fix test failures with pytest 9.2.0 Oct 28, 2026
@ValerianRey
ValerianRey enabled auto-merge (squash) October 28, 2026 09:03
@ValerianRey
ValerianRey disabled auto-merge October 28, 2026 09:03
@ValerianRey
ValerianRey merged commit 9ec6351 into main Oct 28, 2026
19 checks passed
@ValerianRey
ValerianRey deleted the disable-dash-pytest-plugin branch October 28, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: test Conventional commit type for changes to tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant