Re-export assert_output_satisfies from the testing package - #506
Merged
Merged
Conversation
The import shown in semantic.py's own module docstring raised ImportError: testing/__init__.py never imported the module, and the name was absent from __all__, so neither the documented import nor a star import resolved it. Adds the import and the __all__ entry, matching how every other assertion in the package is exposed. semantic.py imports litellm lazily inside the function, so the package-level import does not turn that optional dependency into a hard one -- a test pins that invariant in a subprocess.
ambiorix2099
marked this pull request as ready for review
September 14, 2026 18:37
Replaces the export and star-import assertions with tests for what assert_output_satisfies actually does: threshold pass and fail, the judge reason reaching the assertion message, an unparseable reply failing rather than passing, and a missing litellm raising with an install hint. The tests import through the package rather than the submodule, which is the path semantic.py's docstring documents, so a missing re-export fails collection without asserting on __all__ directly. litellm is stubbed via sys.modules, following test_guardrail.py.
v1r3n
approved these changes
Sep 22, 2026
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.
Summary
from conductor.ai.agents.testing import assert_output_satisfiesraisedImportError, thoughsemantic.py's own module docstring documents exactly that import.testing/__init__.pynever importedsemantic, and the name was absent from__all__, so neither the documented import norfrom conductor.ai.agents.testing import *resolved it.__all__entry, matching how every other assertion in the package is exposed.semantic.pyis untouched.litellma hard dependency of thetestingpackage. It is imported lazily insideassert_output_satisfies, and a new test pins that.User impact
Anyone following the docstring got an
ImportErrorand had to go find the submodule path (conductor.ai.agents.testing.semantic) before they had working code.Changes
testing/__init__.py: importassert_output_satisfiesfromsemantic, and add it to__all__tests/unit/ai/test_testing_semantic.py: new; covers threshold pass and fail, the judge reason reaching the assertion message, an unparseable reply failing rather than passing, and a missinglitellmraising with an install hint. It imports through the package, which is the path the docstring documents, so a missing re-export fails collectionTested with
pytest tests/unit/ai: 1818 pass, five of them new.Fixes #502