Introduce unit tests (#248)

* Proof-of-concept: unittests

* Add pytest-asyncio dep

* Import Body from stream

* Add test for allow_extra_tracks

* Cleanup decorators

* add test to linting

* fix ruff issues

* Run formatter

* fix

* Dont test every python version

---------

Co-authored-by: Marcus Valtonen Örnhag <marcus.valtonen.ornhag@ericsson.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
Marcus Valtonen Örnhag
2025-04-07 23:35:25 +02:00
committed by GitHub
parent 0767030997
commit 2331079c0f
8 changed files with 1246 additions and 898 deletions

View File

@@ -70,7 +70,7 @@ issues = "https://github.com/freddyaboulton/gradio-webrtc/issues"
Documentation = "https://freddyaboulton.github.io/gradio-webrtc/cookbook/"
[project.optional-dependencies]
dev = ["build", "twine"]
dev = ["build", "twine", "httpx", "pytest"]
vad = ["onnxruntime>=1.20.1"]
tts = ["kokoro-onnx"]
stopword = ["fastrtc-moonshine-onnx", "onnxruntime>=1.20.1"]
@@ -82,8 +82,12 @@ artifacts = ["/backend/fastrtc/templates", "*.pyi"]
[tool.hatch.build.targets.wheel]
packages = ["/backend/fastrtc"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope="function"
[tool.ruff]
src = ["demo", "backend/fastrtc"]
src = ["demo", "backend/fastrtc", "test"]
target-version = "py310"
extend-exclude = ["demo/phonic_chat", "demo/nextjs_voice_chat"]