Skip to content

test: refactor rendered audio assertions#132

Merged
osolmaz merged 1 commit into
mainfrom
refactor/render-audio-test-helpers
Jun 13, 2026
Merged

test: refactor rendered audio assertions#132
osolmaz merged 1 commit into
mainfrom
refactor/render-audio-test-helpers

Conversation

@osolmaz

@osolmaz osolmaz commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Added tests/_render_assertions.py for typed rendered-video/audio assertions.
  • Moved ffprobe, pydub, and spectral-bandwidth logic out of tests/test_examples_render.py.
  • Renamed the rendered example test to test_gtts_example_renders_speech_like_audio.
  • Added RenderableExample metadata for the rendered example contract.
  • Registered integration and network pytest 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 -q
  • uv run ruff format --check .
  • uv run ruff check .
  • uv run ty check manim_voiceover
  • uv run mypy --cache-dir=/dev/null manim_voiceover
  • uv run pytest --cov=manim_voiceover --cov-fail-under=85
  • uvx slophammer-py@0.3.0 dry .
  • uvx slophammer-py@0.3.0 check .
  • uv run pip-audit
  • PATH="$PWD/.venv/bin:$PATH" uvx slophammer-py@0.3.0 check . --execute
  • rm -rf dist && uv build
  • rm -rf mutants && uv run mutmut run --max-children 2 && uv run python scripts/check_mutmut_results.py && rm -rf mutants

Risks

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.

@osolmaz
osolmaz merged commit d44dd49 into main Jun 13, 2026
1 check passed
@osolmaz
osolmaz deleted the refactor/render-audio-test-helpers branch June 13, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant