Make the SSIK backend tests isolation-safe - #71
Merged
Merged
Conversation
test_ssik_backend.py reloaded pycbirrt.backends.ssik for every adapter test, replacing the SSIKSolver class object after the example modules had cached the previous one, so the combined SSIK + fallback + UR5e run failed an exact isinstance check while each module passed alone. Import the production module once at collection and never reload it. When the optional dependency is absent, register a stub ssik module once before that import so the fake-solver contract tests still run without SSIK. Check import-state behavior (core never imports ssik; the actionable missing-dependency message) in fresh subprocesses instead of mutating this process's modules. Add a test that the class identity is stable across modules. Fixes #70.
…ubbed name With ssik absent the stub module satisfied importorskip, so the integration class ran against the stub in a core-only environment.
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.
Why
#70: the adapter fixture reloaded
pycbirrt.backends.ssikper test, replacing theSSIKSolverclass after the example modules had cached the old one. Reproduced: the three real-model modules together gave 35 passed, 1 failed at the exact type check; each alone passed.What
ssikmodule is registered once before that import so the fake-solver contract tests still run; nothing else uses the real package in that case.Fixes #70.
Test plan
MUJOCO_MENAGERIE_PATH: 319 passed, 0 skipped.test_ssik_backend.pyruns the fake adapter tests and the import-state subprocess tests, with the real-SSIK integration class skipped.🤖 Generated with Claude Code