fix dash test runner
This commit is contained in:
@@ -15,7 +15,7 @@ import pytest
|
||||
from meshnet_node.model_backend import (
|
||||
InsufficientVRAMError,
|
||||
PartialModelLoadUnsupported,
|
||||
ShardCacheMiss,
|
||||
KVCacheMiss,
|
||||
TensorPayload,
|
||||
TorchModelShard,
|
||||
_call_layer,
|
||||
@@ -629,7 +629,7 @@ def test_shard_cache_decode_miss_is_explicit():
|
||||
torch = pytest.importorskip("torch")
|
||||
shard = _fake_cache_shard(torch)
|
||||
|
||||
with pytest.raises(ShardCacheMiss):
|
||||
with pytest.raises(KVCacheMiss):
|
||||
shard._run_layers(
|
||||
torch.zeros((1, 1, 2), dtype=torch.bfloat16),
|
||||
torch.ones((1, 5), dtype=torch.long),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user