~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
test: fix incorrectly skipped tests and triage xfail
LearningCircuitcf270f87771b
diff --git a/tests/advanced_search_system/test_constraints/test_constraint_classes.py b/tests/advanced_search_system/test_constraints/test_constraint_classes.pyindex a234de227e..b7a1b63319 100644--- a/tests/advanced_search_system/test_constraints/test_constraint_classes.py+++ b/tests/advanced_search_system/test_constraints/test_constraint_classes.py@@ -2,37 +2,57 @@Test constraint and constraint checking classes."""-import pytestfrom loguru import logger+# Import all modules at the top level - these are verified to work+from local_deep_research.advanced_search_system.constraints.base_constraint import (+ Constraint,+ ConstraintType,+)+from local_deep_research.advanced_search_system.constraints.constraint_analyzer import (+ ConstraintAnalyzer,+)+from local_deep_research.advanced_search_system.constraint_checking.base_constraint_checker import (+ BaseConstraintChecker,+)+from local_deep_research.advanced_search_system.constraint_checking.constraint_checker import (+ ConstraintChecker,+)+from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (+ DualConfidenceChecker,+)+from local_deep_research.advanced_search_system.constraint_checking.strict_checker import (+ StrictChecker,+)+from local_deep_research.advanced_search_system.constraint_checking.threshold_checker import (+ ThresholdChecker,+)+from local_deep_research.advanced_search_system.constraint_checking.intelligent_constraint_relaxer import (+ IntelligentConstraintRelaxer,+)+from local_deep_research.advanced_search_system.constraint_checking.rejection_engine import (+ RejectionEngine,+)+from local_deep_research.advanced_search_system.constraint_checking.evidence_analyzer import (+ EvidenceAnalyzer,+)+from local_deep_research.advanced_search_system.candidates.base_candidate import (+ Candidate,+)+class TestConstraintImports:"""Test that constraint-related classes can be imported."""def test_base_constraint_import(self):"""Test base constraint classes import."""- try:- from local_deep_research.advanced_search_system.constraints.base_constraint import (- Constraint,- ConstraintType,- )-- assert Constraint is not None- assert ConstraintType is not None- logger.info("Base constraint classes imported successfully")- except ImportError as e:- pytest.skip(f"Base constraint classes not available: {e}")+ assert Constraint is not None+ assert ConstraintType is not None+ logger.info("Base constraint classes imported successfully")def test_constraint_analyzer_import(self):"""Test ConstraintAnalyzer import."""- try:- from local_deep_research.advanced_search_system.constraints.constraint_analyzer import (- ConstraintAnalyzer,- )-- assert ConstraintAnalyzer is not None- except ImportError as e:- pytest.skip(f"ConstraintAnalyzer not available: {e}")+ assert ConstraintAnalyzer is not Noneclass TestConstraintCheckingImports:@@ -40,91 +60,35 @@ class TestConstraintCheckingImports:def test_base_constraint_checker_import(self):"""Test base constraint checker import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.base_constraint_checker import (- BaseConstraintChecker,- )-- assert BaseConstraintChecker is not None- except ImportError as e:- pytest.skip(f"BaseConstraintChecker not available: {e}")+ assert BaseConstraintChecker is not Nonedef test_constraint_checker_import(self):"""Test ConstraintChecker import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.constraint_checker import (- ConstraintChecker,- )-- assert ConstraintChecker is not None- except ImportError as e:- pytest.skip(f"ConstraintChecker not available: {e}")+ assert ConstraintChecker is not Nonedef test_dual_confidence_checker_import(self):"""Test DualConfidenceChecker import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (- DualConfidenceChecker,- )-- assert DualConfidenceChecker is not None- except ImportError as e:- pytest.skip(f"DualConfidenceChecker not available: {e}")+ assert DualConfidenceChecker is not Nonedef test_strict_checker_import(self):"""Test StrictChecker import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.strict_checker import (- StrictChecker,- )-- assert StrictChecker is not None- except ImportError as e:- pytest.skip(f"StrictChecker not available: {e}")+ assert StrictChecker is not Nonedef test_threshold_checker_import(self):"""Test ThresholdChecker import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.threshold_checker import (- ThresholdChecker,- )-- assert ThresholdChecker is not None- except ImportError as e:- pytest.skip(f"ThresholdChecker not available: {e}")+ assert ThresholdChecker is not Nonedef test_intelligent_constraint_relaxer_import(self):"""Test IntelligentConstraintRelaxer import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.intelligent_constraint_relaxer import (- IntelligentConstraintRelaxer,- )-- assert IntelligentConstraintRelaxer is not None- except ImportError as e:- pytest.skip(f"IntelligentConstraintRelaxer not available: {e}")+ assert IntelligentConstraintRelaxer is not Nonedef test_rejection_engine_import(self):"""Test RejectionEngine import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.rejection_engine import (- RejectionEngine,- )-- assert RejectionEngine is not None- except ImportError as e:- pytest.skip(f"RejectionEngine not available: {e}")+ assert RejectionEngine is not Nonedef test_evidence_analyzer_import(self):"""Test EvidenceAnalyzer import."""- try:- from local_deep_research.advanced_search_system.constraint_checking.evidence_analyzer import (- EvidenceAnalyzer,- )-- assert EvidenceAnalyzer is not None- except ImportError as e:- pytest.skip(f"EvidenceAnalyzer not available: {e}")+ assert EvidenceAnalyzer is not Noneclass TestConstraintAnalyzer:@@ -132,19 +96,9 @@ class TestConstraintAnalyzer:def test_instantiation(self, mock_llm):"""Test that analyzer can be instantiated."""- try:- from local_deep_research.advanced_search_system.constraints.constraint_analyzer import (- ConstraintAnalyzer,- )-- analyzer = ConstraintAnalyzer(mock_llm)- assert analyzer is not None- logger.info("ConstraintAnalyzer instantiated successfully")-- except ImportError as e:- pytest.skip(f"ConstraintAnalyzer not available: {e}")- except Exception as e:- pytest.skip(f"ConstraintAnalyzer instantiation failed: {e}")+ analyzer = ConstraintAnalyzer(mock_llm)+ assert analyzer is not None+ logger.info("ConstraintAnalyzer instantiated successfully")class TestConstraintChecker:@@ -152,19 +106,9 @@ class TestConstraintChecker:def test_instantiation(self, mock_llm):"""Test that checker can be instantiated."""- try:- from local_deep_research.advanced_search_system.constraint_checking.constraint_checker import (- ConstraintChecker,- )-- checker = ConstraintChecker(mock_llm)- assert checker is not None- logger.info("ConstraintChecker instantiated successfully")-- except ImportError as e:- pytest.skip(f"ConstraintChecker not available: {e}")- except Exception as e:- pytest.skip(f"ConstraintChecker instantiation failed: {e}")+ checker = ConstraintChecker(mock_llm)+ assert checker is not None+ logger.info("ConstraintChecker instantiated successfully")class TestDualConfidenceChecker:@@ -172,19 +116,9 @@ class TestDualConfidenceChecker:def test_instantiation(self, mock_llm):"""Test that checker can be instantiated."""- try:- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (- DualConfidenceChecker,- )-- checker = DualConfidenceChecker(mock_llm)- assert checker is not None- logger.info("DualConfidenceChecker instantiated successfully")-- except ImportError as e:- pytest.skip(f"DualConfidenceChecker not available: {e}")- except Exception as e:- pytest.skip(f"DualConfidenceChecker instantiation failed: {e}")+ checker = DualConfidenceChecker(mock_llm)+ assert checker is not None+ logger.info("DualConfidenceChecker instantiated successfully")class TestConstraintCheckerFunctionality:@@ -192,64 +126,38 @@ class TestConstraintCheckerFunctionality:def test_constraint_checker_with_custom_thresholds(self, mock_llm):"""Test ConstraintChecker with custom thresholds."""- try:- from local_deep_research.advanced_search_system.constraint_checking.constraint_checker import (- ConstraintChecker,- )-- checker = ConstraintChecker(- model=mock_llm,- negative_threshold=0.3,- positive_threshold=0.5,- uncertainty_penalty=0.15,- negative_weight=0.6,- )-- assert checker.rejection_engine is not None- assert checker.evidence_analyzer is not None- logger.info("ConstraintChecker with custom thresholds created")-- except ImportError as e:- pytest.skip(f"ConstraintChecker not available: {e}")+ checker = ConstraintChecker(+ model=mock_llm,+ negative_threshold=0.3,+ positive_threshold=0.5,+ uncertainty_penalty=0.15,+ negative_weight=0.6,+ )++ assert checker.rejection_engine is not None+ assert checker.evidence_analyzer is not None+ logger.info("ConstraintChecker with custom thresholds created")def test_constraint_checker_without_evidence_gatherer(self, mock_llm):"""Test checker behavior without evidence gatherer."""- try:- from local_deep_research.advanced_search_system.constraint_checking.constraint_checker import (- ConstraintChecker,- )- from local_deep_research.advanced_search_system.candidates.base_candidate import (- Candidate,- )- from local_deep_research.advanced_search_system.constraints.base_constraint import (- Constraint,- ConstraintType,- )-- checker = ConstraintChecker(model=mock_llm)-- # Create test candidate and constraint- candidate = Candidate(name="Test Candidate")- constraint = Constraint(- id="recency_constraint",- type=ConstraintType.TEMPORAL,- description="Must be recent",- value="recent",- weight=1.0,- )-- # Should handle gracefully without evidence gatherer- result = checker.check_candidate(candidate, [constraint])-- assert result is not None- assert result.candidate == candidate- logger.info(f"Checker returned score: {result.total_score}")-- except ImportError as e:- pytest.skip(f"Required classes not available: {e}")- except Exception as e:- logger.warning(f"Test failed: {e}")- pytest.skip(f"Test has issues: {e}")+ checker = ConstraintChecker(model=mock_llm)++ # Create test candidate and constraint+ candidate = Candidate(name="Test Candidate")+ constraint = Constraint(+ id="recency_constraint",+ type=ConstraintType.TEMPORAL,+ description="Must be recent",+ value="recent",+ weight=1.0,+ )++ # Should handle gracefully without evidence gatherer+ result = checker.check_candidate(candidate, [constraint])++ assert result is not None+ assert result.candidate == candidate+ logger.info(f"Checker returned score: {result.total_score}")class TestEvidenceAnalyzer:@@ -257,18 +165,10 @@ class TestEvidenceAnalyzer:def test_instantiation(self, mock_llm):"""Test that analyzer can be instantiated."""- try:- from local_deep_research.advanced_search_system.constraint_checking.evidence_analyzer import (- EvidenceAnalyzer,- )-- analyzer = EvidenceAnalyzer(mock_llm)- assert analyzer is not None- assert analyzer.model == mock_llm- logger.info("EvidenceAnalyzer instantiated successfully")-- except ImportError as e:- pytest.skip(f"EvidenceAnalyzer not available: {e}")+ analyzer = EvidenceAnalyzer(mock_llm)+ assert analyzer is not None+ assert analyzer.model == mock_llm+ logger.info("EvidenceAnalyzer instantiated successfully")class TestRejectionEngine:@@ -276,36 +176,20 @@ class TestRejectionEngine:def test_instantiation_default_thresholds(self):"""Test RejectionEngine with default thresholds."""- try:- from local_deep_research.advanced_search_system.constraint_checking.rejection_engine import (- RejectionEngine,- )-- engine = RejectionEngine()- assert engine is not None- logger.info("RejectionEngine instantiated with defaults")-- except ImportError as e:- pytest.skip(f"RejectionEngine not available: {e}")+ engine = RejectionEngine()+ assert engine is not None+ logger.info("RejectionEngine instantiated with defaults")def test_instantiation_custom_thresholds(self):"""Test RejectionEngine with custom thresholds."""- try:- from local_deep_research.advanced_search_system.constraint_checking.rejection_engine import (- RejectionEngine,- )-- engine = RejectionEngine(- negative_threshold=0.3,- positive_threshold=0.5,- )-- assert engine.negative_threshold == 0.3- assert engine.positive_threshold == 0.5- logger.info("RejectionEngine with custom thresholds created")+ engine = RejectionEngine(+ negative_threshold=0.3,+ positive_threshold=0.5,+ )- except ImportError as e:- pytest.skip(f"RejectionEngine not available: {e}")+ assert engine.negative_threshold == 0.3+ assert engine.positive_threshold == 0.5+ logger.info("RejectionEngine with custom thresholds created")class TestIntelligentConstraintRelaxer:@@ -313,17 +197,9 @@ class TestIntelligentConstraintRelaxer:def test_instantiation(self):"""Test that relaxer can be instantiated."""- try:- from local_deep_research.advanced_search_system.constraint_checking.intelligent_constraint_relaxer import (- IntelligentConstraintRelaxer,- )-- relaxer = IntelligentConstraintRelaxer()- assert relaxer is not None- logger.info("IntelligentConstraintRelaxer instantiated")-- except ImportError as e:- pytest.skip(f"IntelligentConstraintRelaxer not available: {e}")+ relaxer = IntelligentConstraintRelaxer()+ assert relaxer is not None+ logger.info("IntelligentConstraintRelaxer instantiated")class TestConstraintDataClasses:@@ -331,49 +207,32 @@ class TestConstraintDataClasses:def test_constraint_creation(self):"""Test Constraint dataclass creation."""- try:- from local_deep_research.advanced_search_system.constraints.base_constraint import (- Constraint,- ConstraintType,- )-- constraint = Constraint(- id="test_constraint",- type=ConstraintType.TEMPORAL,- description="Must be from 2023",- value="2023",- weight=1.5,- )-- assert constraint.value == "2023"- assert constraint.type == ConstraintType.TEMPORAL- assert constraint.weight == 1.5- assert constraint.id == "test_constraint"- assert constraint.description == "Must be from 2023"- logger.info("Constraint created successfully")-- except ImportError as e:- pytest.skip(f"Constraint classes not available: {e}")+ constraint = Constraint(+ id="test_constraint",+ type=ConstraintType.TEMPORAL,+ description="Must be from 2023",+ value="2023",+ weight=1.5,+ )++ assert constraint.value == "2023"+ assert constraint.type == ConstraintType.TEMPORAL+ assert constraint.weight == 1.5+ assert constraint.id == "test_constraint"+ assert constraint.description == "Must be from 2023"+ logger.info("Constraint created successfully")def test_constraint_types(self):"""Test all ConstraintType enum values exist."""- try:- from local_deep_research.advanced_search_system.constraints.base_constraint import (- ConstraintType,- )-- # Check common constraint types exist- assert hasattr(ConstraintType, "TEMPORAL")- assert hasattr(ConstraintType, "LOCATION")-- # Get all types- all_types = list(ConstraintType)- logger.info(- f"ConstraintType has {len(all_types)} types: {[t.value for t in all_types]}"- )+ # Check common constraint types exist+ assert hasattr(ConstraintType, "TEMPORAL")+ assert hasattr(ConstraintType, "LOCATION")- except ImportError as e:- pytest.skip(f"ConstraintType not available: {e}")+ # Get all types+ all_types = list(ConstraintType)+ logger.info(+ f"ConstraintType has {len(all_types)} types: {[t.value for t in all_types]}"+ )class TestCandidateClass:@@ -381,35 +240,19 @@ class TestCandidateClass:def test_candidate_creation(self):"""Test Candidate class creation."""- try:- from local_deep_research.advanced_search_system.candidates.base_candidate import (- Candidate,- )-- candidate = Candidate(name="Test Entity")- assert candidate.name == "Test Entity"- logger.info("Candidate created successfully")-- except ImportError as e:- pytest.skip(f"Candidate class not available: {e}")+ candidate = Candidate(name="Test Entity")+ assert candidate.name == "Test Entity"+ logger.info("Candidate created successfully")def test_candidate_with_additional_fields(self):"""Test Candidate with additional fields if supported."""- try:- from local_deep_research.advanced_search_system.candidates.base_candidate import (- Candidate,- )-- # Try to create with additional fields- candidate = Candidate(- name="Test Entity",- )-- assert candidate.name == "Test Entity"+ # Try to create with additional fields+ candidate = Candidate(+ name="Test Entity",+ )- # Check what attributes are available- attrs = [a for a in dir(candidate) if not a.startswith("_")]- logger.info(f"Candidate attributes: {attrs}")+ assert candidate.name == "Test Entity"- except ImportError as e:- pytest.skip(f"Candidate class not available: {e}")+ # Check what attributes are available+ attrs = [a for a in dir(candidate) if not a.startswith("_")]+ logger.info(f"Candidate attributes: {attrs}")diff --git a/tests/fix_tests/test_milestone_logging_fix.py b/tests/fix_tests/test_milestone_logging_fix.pyindex 4c05bf6b38..e7833c9488 100644--- a/tests/fix_tests/test_milestone_logging_fix.py+++ b/tests/fix_tests/test_milestone_logging_fix.py@@ -6,21 +6,11 @@ import jsonfrom datetime import datetimefrom unittest.mock import MagicMock, Mock, patch-import pytest--# Skip all tests in this file temporarily to debug CI timeout-pytestmark = pytest.mark.skip(reason="Debugging CI timeout issue")--# Import functions even though tests are skipped to satisfy linter-try:- from local_deep_research.utilities.log_utils import (- _get_research_id,- frontend_progress_sink,- )-except ImportError:- # Fallback imports for CI environment- frontend_progress_sink = None- _get_research_id = None++from local_deep_research.utilities.log_utils import (+ _get_research_id,+ frontend_progress_sink,+)class TestMilestoneLogging:diff --git a/tests/search_engines/test_search_engine_ddg.py b/tests/search_engines/test_search_engine_ddg.pyindex 737caa209f..129c45574d 100644--- a/tests/search_engines/test_search_engine_ddg.py+++ b/tests/search_engines/test_search_engine_ddg.py@@ -2,16 +2,16 @@Comprehensive tests for the DuckDuckGo search engine.Tests initialization, search functionality, error handling, and result parsing.-Note: These tests require the 'ddgs' package to be installed.+Note: These tests require the 'duckduckgo_search' package to be installed."""import pytestfrom unittest.mock import Mock, patch-# Check if ddgs package is available (required by langchain DuckDuckGoSearchAPIWrapper)+# Check if duckduckgo_search package is available (required for DuckDuckGo search)import importlib.util-DDGS_AVAILABLE = importlib.util.find_spec("ddgs") is not None+DDGS_AVAILABLE = importlib.util.find_spec("duckduckgo_search") is not None@pytest.mark.skipif(not DDGS_AVAILABLE, reason="ddgs package not installed")