Spaces:
Configuration error
Configuration error
File size: 573 Bytes
313814b 81fa68b 313814b 81fa68b |
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 |
import logging
import os
from typing import Generator
import pytest
from fastapi.testclient import TestClient
# HACK
os.environ["WHISPER_MODEL"] = "Systran/faster-whisper-tiny.en"
from faster_whisper_server.main import app # noqa: E402
disable_loggers = ["multipart.multipart", "faster_whisper"]
def pytest_configure():
for logger_name in disable_loggers:
logger = logging.getLogger(logger_name)
logger.disabled = True
@pytest.fixture()
def client() -> Generator[TestClient, None, None]:
with TestClient(app) as client:
yield client
|