Initial commit: SearXNG CLI Toolkit v1.6.0
CI / test (3.8) (push) Canceled after 0s
CI / test (3.9) (push) Canceled after 0s
CI / test (3.10) (push) Canceled after 0s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s

Multi-instance failover, exponential-backoff retry, SQLite cache, batch mode, domain filter, cross-engine dedup, result sorting, CSV export, structured logging, enhanced Markdown conversion, 155 pytest tests, Gitea Actions CI
This commit is contained in:
Metona Team
2026-08-01 17:02:34 +08:00
commit 0468dd4e9d
17 changed files with 4791 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"""Shared fixtures and path setup for the searxng-cli test suite.
This conftest is loaded by pytest before any test module is imported, so
the ``sys.path`` insertion below makes the scripts/ directory importable
as top-level modules (``search``, ``fetch``, ``common``, ``cache``, ``_config``)
without requiring a package install.
"""
import sys
from pathlib import Path
# Make scripts/ importable as top-level modules.
SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "scripts"
if str(SCRIPTS_DIR) not in sys.path:
sys.path.insert(0, str(SCRIPTS_DIR))
import pytest
@pytest.fixture
def isolated_cache(monkeypatch, tmp_path):
"""Redirect the SQLite cache to a per-test temp directory.
``cache._cache_path()`` reads ``$SEARXNG_CACHE_DIR``; pointing it at a
fresh ``tmp_path`` keeps each test hermetic and prevents cross-test
contamination from leftover entries.
"""
monkeypatch.setenv("SEARXNG_CACHE_DIR", str(tmp_path))
return tmp_path