Skip to content

Commit 1bd0084

Browse files
xitzhangXiting Zhangscbedd
authored
[VoiceLive] Update assets path by devtools_testutils (#43178)
* [VoiceLive] Add tests * modify tests * update test * update env vars * update path of preparer * remove live test tag * update async config * update test resources * update * update * update models * update * update * update * update tests.yml construction * update assets * update mark * update pylint * update for 1.0.0b5 * remove useless resources * update async option * update for whl_no_aio env * update * [VoiceLive] Update assets path by devtools_testutils * remove markers * update import sequence --------- Co-authored-by: Xiting Zhang <[email protected]> Co-authored-by: Scott Beddall <[email protected]>
1 parent 279a3ce commit 1bd0084

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sdk/ai/azure-ai-voicelive/tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
is_live
1111
)
1212

13+
from devtools_testutils.helpers import locate_assets
1314
from pathlib import Path
1415

1516
def pytest_runtest_setup(item):
@@ -25,7 +26,9 @@ def pytest_runtest_setup(item):
2526

2627
@pytest.fixture
2728
def test_data_dir() -> Path:
28-
return Path(__file__).parent / "data"
29+
base = Path(locate_assets(current_test_file=Path(__file__))) # ensure Path
30+
full = base / "python" / "sdk" / "ai" / "azure-ai-voicelive" / "tests" / "data"
31+
return full
2932

3033
@pytest.fixture(scope="session", autouse=True)
3134
def start_proxy(test_proxy):

sdk/ai/azure-ai-voicelive/tests/test_live_realtime_service.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
import base64
55
import asyncio
66
import json
7+
78
from pathlib import Path
89
from typing import Callable, Iterator, Literal, Mapping, Union, Any, Type
910
import pytest
11+
12+
pytest.importorskip(
13+
"aiohttp",
14+
reason="Skipping aio tests: aiohttp not installed (whl_no_aio).",
15+
)
16+
1017
from azure.core.credentials import AzureKeyCredential
1118
from azure.ai.voicelive.aio import connect
1219
from azure.ai.voicelive.models import (

0 commit comments

Comments
 (0)