Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: delete 7 H4_ASSERTS_MOCK tests in test_adaptive_explorer.py (#4283)

LearningCircuitf70edb13aadb
diff --git a/tests/advanced_search_system/candidate_exploration/test_adaptive_explorer.py b/tests/advanced_search_system/candidate_exploration/test_adaptive_explorer.py
index 9d07d85a64..f7cb26e2a4 100644
--- a/tests/advanced_search_system/candidate_exploration/test_adaptive_explorer.py
+++ b/tests/advanced_search_system/candidate_exploration/test_adaptive_explorer.py
@@ -181,36 +181,6 @@ class TestExplore:
result = explorer.explore("test query")
assert isinstance(result.exploration_paths, list)
- def test_deduplicates_candidates(self, explorer, mock_model):
- """Test candidates are deduplicated."""
- mock_model.invoke.return_value = Mock(
- content="Candidate 1\nCandidate 1"
- )
- with patch.object(
- explorer, "_should_continue_exploration", side_effect=[True, False]
- ):
- with patch.object(
- explorer, "_deduplicate_candidates"
- ) as mock_dedup:
- mock_dedup.return_value = []
- explorer.explore("test query")
- mock_dedup.assert_called()
-
- def test_ranks_candidates(self, explorer, mock_model):
- """Test candidates are ranked by relevance."""
- mock_model.invoke.return_value = Mock(
- content="Candidate 1\nCandidate 2"
- )
- with patch.object(
- explorer, "_should_continue_exploration", side_effect=[True, False]
- ):
- with patch.object(
- explorer, "_rank_candidates_by_relevance"
- ) as mock_rank:
- mock_rank.return_value = []
- explorer.explore("test query")
- mock_rank.assert_called()
-
def test_limits_to_max_candidates(self, explorer, mock_model):
"""Test results are limited to max_candidates."""
explorer.max_candidates = 2
@@ -221,46 +191,6 @@ class TestExplore:
result = explorer.explore("test query")
assert len(result.candidates) <= 2
- def test_updates_strategy_stats_during_exploration(self, explorer):
- """Test strategy stats are updated during exploration."""
- with patch.object(
- explorer, "_should_continue_exploration", side_effect=[True, False]
- ):
- with patch.object(
- explorer, "_update_strategy_stats"
- ) as mock_update:
- explorer.explore("test query")
- mock_update.assert_called()
-
- def test_adapts_strategy_at_threshold(self, explorer):
- """Test strategy adapts when threshold reached."""
- explorer.adaptation_threshold = 1
- with patch.object(
- explorer,
- "_should_continue_exploration",
- side_effect=[True, True, False],
- ):
- with patch.object(explorer, "_adapt_strategy") as mock_adapt:
- explorer.explore("test query")
- mock_adapt.assert_called()
-
- def test_skips_already_explored_queries(self, explorer):
- """Test already explored queries are skipped."""
- # Add all possible variations to explored queries
- explorer.explored_queries.add('"test query" examples')
- explorer.explored_queries.add("test query list")
- explorer.explored_queries.add("test query instances")
- explorer.explored_queries.add("types of test query")
- explorer.explored_queries.add("test query")
-
- with patch.object(
- explorer, "_should_continue_exploration", side_effect=[True, False]
- ):
- with patch.object(explorer, "_try_next_strategy") as mock_try:
- mock_try.return_value = False
- explorer.explore("test query")
- mock_try.assert_called()
-
def test_includes_elapsed_time(self, explorer):
"""Test result includes elapsed time."""
with patch.object(
@@ -301,29 +231,6 @@ class TestGenerateExplorationQueries:
result = explorer.generate_exploration_queries("base query", [])
assert isinstance(result, list)
- def test_uses_top_strategies(self, explorer):
- """Test queries are generated using top strategies."""
- with patch.object(explorer, "_get_top_strategies") as mock_top:
- mock_top.return_value = ["direct_search"]
- explorer.generate_exploration_queries("base query", [])
- mock_top.assert_called_with(3)
-
- def test_generates_queries_for_each_strategy(
- self, explorer, mock_candidates
- ):
- """Test generates queries for each top strategy."""
- explorer.strategy_stats["strategy_a"]["attempts"] = 10
- explorer.strategy_stats["strategy_a"]["candidates_found"] = 50
- explorer.strategy_stats["strategy_b"]["attempts"] = 10
- explorer.strategy_stats["strategy_b"]["candidates_found"] = 30
-
- with patch.object(
- explorer, "_generate_query_with_strategy"
- ) as mock_gen:
- mock_gen.return_value = "generated query"
- explorer.generate_exploration_queries("base", mock_candidates)
- assert mock_gen.call_count >= 1
-
def test_skips_none_queries(self, explorer):
"""Test None queries are not included."""
with patch.object(