Skip to content

Commit e589dcf

Browse files
committed
test(tts): keep model-less nodes collectible
1 parent 79a0b4d commit e589dcf

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tests/test_local_tts_semantic_guard.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,29 @@
99
import pytest
1010

1111

12-
if os.environ.get("AMADEUS_E2E_NO_TTS", "").strip().lower() in {
12+
_MODEL_LESS = os.environ.get("AMADEUS_E2E_NO_TTS", "").strip().lower() in {
1313
"1",
1414
"true",
1515
"yes",
1616
"on",
17-
}:
18-
pytest.skip("full TTS runtime is disabled in model-less CI", allow_module_level=True)
17+
}
18+
pytestmark = pytest.mark.skipif(
19+
_MODEL_LESS,
20+
reason="full TTS runtime is disabled in model-less CI",
21+
)
1922

2023
import torch
2124

2225

2326
ROOT = Path(__file__).resolve().parents[1]
2427
sys.path.insert(0, str(ROOT))
2528

26-
from local_tts_infer import TTSInferencer
27-
from tts.semantic_stability import SemanticGenerationError
29+
if not _MODEL_LESS:
30+
from local_tts_infer import TTSInferencer
31+
from tts.semantic_stability import SemanticGenerationError
32+
else:
33+
TTSInferencer = object
34+
SemanticGenerationError = RuntimeError
2835

2936

3037
class _FakeSemanticDecoder:

0 commit comments

Comments
 (0)