This repository was archived by the owner on Mar 29, 2026. It is now read-only.
fix: skip sanity tests gracefully when optional dependencies are missing#1108
Open
Wmx-5Percent wants to merge 1 commit into
Open
fix: skip sanity tests gracefully when optional dependencies are missing#1108Wmx-5Percent wants to merge 1 commit into
Wmx-5Percent wants to merge 1 commit into
Conversation
- Add try/except ImportError: pytest.skip() guards to 5 database runner test classes (ClickHouse, Oracle, MSSQL, Presto, Hive) in test_database_sanity.py so they skip instead of fail when optional packages (clickhouse_connect, oracledb, pyodbc, pyhive) are not installed. - Fix incorrect attribute assertion in test_agent_memory_sanity.py: FAISSAgentMemory stores the path as 'index_path', not 'persist_path'. Follows the existing try/except skip pattern used in test_agent_memory_sanity.py for other optional memory backends. Before: 6 FAILED (ModuleNotFoundError / AttributeError) After: 5 SKIPPED, 1 PASSED (previously failing FAISS test now correct)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
6 sanity tests fail with
ModuleNotFoundErrororAttributeErrorwhen optional dependencies are not installed, rather than being gracefully skipped:test_database_sanity.py— 5 failures:TestClickHouseRunner(4 methods) —clickhouse_connectnot installedTestOracleRunner(4 methods) —oracledbnot installedTestMSSQLRunner(4 methods) —pyodbcnot installedTestPrestoRunner(4 methods) —pyhivenot installedTestHiveRunner(4 methods) —pyhivenot installedtest_agent_memory_sanity.py— 1 failure:TestFAISSAgentMemory::test_faiss_instantiation— assertsmemory.persist_pathbutFAISSAgentMemorystores the path asself.index_pathFix
1. Database runner tests (
test_database_sanity.py)Added
try/except ImportError: pytest.skip(...)guards to all 20 test methods across the 5 affected test classes. This covers both:ImportError(when the integration module can't be imported)ImportError(when the Runner's__init__checks for the underlying package)This follows the exact same pattern already used in
test_agent_memory_sanity.pyfor optional memory backends (ChromaDB, Qdrant, Pinecone, Milvus, Weaviate, FAISS, OpenSearch, AzureAISearch, Marqo).2. FAISS memory test (
test_agent_memory_sanity.py)Fixed the incorrect attribute assertion:
memory.persist_path→memory.index_path, matching the actualFAISSAgentMemory.__init__which stores the path asself.index_path.Before
After
Test Results
Full local test suite (excluding integration tests requiring API keys):
Checklist
ruff format— no changes neededruff check— all checks passed