Repository navigation
fix(tests): the auto-dispatch test declares its psycopg dependency - #986
Conversation
…needs
test_engine_selected_auto_backend_reaches_hook[False-wheel] and
[False-launcher] failed on every install without the [postgresql] extra with
"assert None is <object object>". They replace db_connect.pg_connect and
expect auto_recall._connect to return that fake connection, but _connect
imports psycopg first and returns None when the import fails, so the fake is
never reached. The dependency was not declared: the test failed instead of
being skipped, unlike the other tests that need the driver.
The two PostgreSQL parameters now call pytest.importorskip("psycopg") with the
reason the other tests give. The SQLite parameters and every assertion are
unchanged; with the driver installed, as in CI, nothing is skipped.
Here (no psycopg): 2 passed, 2 skipped, before 2 passed, 2 failed. Not
verified with psycopg installed (it cannot be installed in this container).
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_018kyZYrKg46KKYpvLPXcW4M
Signed-off-by: Claude <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYrKg46KKYpvLPXcW4M Signed-off-by: Claude <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 1m 13s —— View job Review of PR #986 (review 1 of 3)
There are no Blockers and one Note. What I checked:
Note: the skip covers more than it needs to. The checks at lines 78–83 don't need psycopg; only line 84 does. Not done: the Verdict: approve |
Review 1 of 3: PR #986No Blockers. I checked the cause. Without psycopg, I didn't run pytest locally because this job's permissions blocked it. This PR's CI run is the execution check. Notes, no action before merge
View job run |
What was wrong
tests_py/hooks/test_entry_auto_dispatch.py::test_engine_selected_auto_backend_reaches_hook[False-wheel]and[False-launcher]fail on the documented dev install (--extra dev, with or without--extra sqlite):Cause: an undeclared dependency on
psycopg.db_connect.pg_connectwith a fake and expectsauto_recall._connect()to return it._connectfirst doesimport psycopgand returnsNoneonImportError, so the fake is never reached.psycopgbelongs to the optional[postgresql]extra, which the documented dev install does not include.pytest.importorskip("psycopg", …); this one did not, so it failed where it should have been skipped.What
The two PostgreSQL parameters call
pytest.importorskip("psycopg", reason="psycopg not installed ([postgresql] extra)")at the top of the test. The SQLite parameters and every assertion are unchanged.In CI nothing changes: the
unitcommand ofci.jsoninstalls--extra postgresql, so the two tests run and are not skipped there.Checks
2 passed, 2 skipped, withSKIPPED [2] … psycopg not installed ([postgresql] extra). Same result withmainmerged in.ruff check,ruff format --check: clean.scripts/check_craftsmanship.py: OK.Not verified
The two tests with
psycopgactually installed were not run locally; this pull request's CI runs them.No CHANGELOG entry: a six-line, test-only change.
Generated by Claude Code