test: refactor rendered audio assertions#132
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened on behalf of Onur Solmaz (
osolmaz).Summary
The rendered gTTS example test had the audio parsing and spectral checks inline.
This change cuts over to named test helpers so the scenario stays readable and the audio assertions are reusable.
It keeps the same real gTTS render coverage and marks it clearly as an integration/network test.
What Changed
The test now reads as a render scenario instead of mixing subprocess setup, ffprobe parsing, audio loading, and FFT math in one file.
There is no compatibility shim or duplicate legacy path left behind.
tests/_render_assertions.pyfor typed rendered-video/audio assertions.ffprobe,pydub, and spectral-bandwidth logic out oftests/test_examples_render.py.test_gtts_example_renders_speech_like_audio.RenderableExamplemetadata for the rendered example contract.integrationandnetworkpytest markers.Testing
I ran the focused render test and the full local gate set.
The real gTTS example still renders through Manim and passes the speech-like audio assertions.
Mutation testing passed with no surviving, timed-out, suspicious, or untested mutants.
GitHub Actions build passed on commit
5c74f68.uv run pytest tests/test_examples_render.py -quv run ruff format --check .uv run ruff check .uv run ty check manim_voiceoveruv run mypy --cache-dir=/dev/null manim_voiceoveruv run pytest --cov=manim_voiceover --cov-fail-under=85uvx slophammer-py@0.3.0 dry .uvx slophammer-py@0.3.0 check .uv run pip-auditPATH="$PWD/.venv/bin:$PATH" uvx slophammer-py@0.3.0 check . --executerm -rf dist && uv buildrm -rf mutants && uv run mutmut run --max-children 2 && uv run python scripts/check_mutmut_results.py && rm -rf mutantsRisks
This is a test-only refactor plus pytest marker registration.
The main remaining risk is still the existing one: the gTTS rendered example depends on outbound network access.