fix dash test runner

This commit is contained in:
Dobromir Popov
2026-07-11 21:59:43 +03:00
parent bd99c5177b
commit c195b5ce78
3 changed files with 34 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ constructed without an explicit ``repo_root``.
"""
import json
import sys
import time
import urllib.error
import urllib.request
@@ -16,7 +17,7 @@ import pytest
from meshnet_tracker.accounts import AccountStore
from meshnet_tracker.server import TrackerServer
from meshnet_tracker.test_runner import TestRunManager as RunManager
from meshnet_tracker.test_runner import discover_repo_root
from meshnet_tracker.test_runner import _test_python, discover_repo_root
def _make_repo(tmp_path: Path) -> Path:
@@ -119,6 +120,16 @@ def test_enable_flag_constructs_runner_against_real_repo(monkeypatch):
assert (tracker._test_runner.repo_root / "tests" / "conftest.py").is_file()
def test_runner_uses_configured_project_python(monkeypatch, tmp_path):
python = tmp_path / "python"
python.touch(mode=0o755)
monkeypatch.setenv("MESHNET_PYTHON", str(python))
assert _test_python() == str(python)
monkeypatch.setenv("MESHNET_PYTHON", str(tmp_path / "missing-python"))
assert _test_python() == sys.executable
def test_collection_lists_tests_and_excludes_real_inference(tmp_path, monkeypatch):
monkeypatch.delenv("MESHNET_ENABLE_REAL_INFERENCE_TESTS", raising=False)
tracker, port, admin, _user = _start_tracker(tmp_path)