diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..67f2d76 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,21 @@ +"""모든 테스트 공통 설정.""" + +from __future__ import annotations + +from types import SimpleNamespace + +import pytest + + +@pytest.fixture(autouse=True) +def _no_cublas_download(monkeypatch): + """엔진 테스트가 Windows 에서 cuBLAS(541MB)를 실제로 받지 않게 한다. + + 기본 설정이 device=cuda 라 엔진을 띄우면 Windows 에서는 시작 때 cuBLAS 를 + 준비한다. 그러면 시작이 느려져 시간 제한이 있는 테스트가 실패한다. 엔진이 + 붙잡은 모듈 참조만 바꾸므로 `test_cuda_runtime` 은 진짜 모듈을 그대로 본다. + """ + monkeypatch.setattr( + "livesub.core.engine.cuda_runtime", + SimpleNamespace(ensure=lambda *args, **kwargs: False), + )