File: conftest.py

package info (click to toggle)
python-azure 20251118%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 783,356 kB
  • sloc: python: 6,474,533; ansic: 804; javascript: 287; sh: 205; makefile: 198; xml: 109
file content (35 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Pytest configuration for Azure AI Voice Live SDK tests.
"""

import pytest
import os
import base64
from devtools_testutils import test_proxy, is_live

from devtools_testutils.helpers import locate_assets
from pathlib import Path


def pytest_runtest_setup(item):
    is_live_only_test_marked = bool([mark for mark in item.iter_markers(name="live_test_only")])
    if is_live_only_test_marked:
        if not is_live():
            pytest.skip("live test only")

    is_playback_test_marked = bool([mark for mark in item.iter_markers(name="playback_test_only")])
    if is_playback_test_marked:
        if is_live():
            pytest.skip("playback test only")


@pytest.fixture
def test_data_dir() -> Path:
    base = Path(locate_assets(current_test_file=Path(__file__)))  # ensure Path
    full = base / "python" / "sdk" / "ai" / "azure-ai-voicelive" / "tests" / "data"
    return full


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