mirror of
https://github.com/adefossez/seewav.git
synced 2026-04-26 06:15:55 +03:00
[PR #14] Add unit test #14
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/seewav#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adefossez/seewav/pull/14
Author: @nwaughachukwuma
Created: 4/20/2025
Status: 🔄 Open
Base:
master← Head:add-unit-test📝 Commits (7)
ee2727aAdd pytest configuration and core logic tests for seewav842a2c2Add GitHub Actions CI workflow for running unit tests2f06ec0Enhance CI workflow to include coverage reporting and additional test dependencies7ee1b1dAdd type annotations to public functions and create meta-tests for type coverage3896a50Add support for custom output dimensions via --size CLI optionec4484dAdd argument-validation tests for seewav helper utilities8dd98d9Merge pull request #1 from nwaughachukwuma/add-function-signatures📊 Changes
8 files changed (+711 additions, -130 deletions)
View changed files
➕
.coveragerc(+10 -0)➕
.github/workflows/ci.yml(+70 -0)📝
README.md(+32 -2)📝
seewav.py(+237 -128)➕
tests/conftest.py(+76 -0)➕
tests/test_arguments.py(+132 -0)➕
tests/test_basic.py(+106 -0)➕
tests/test_signatures.py(+48 -0)📄 Description
Summary
This PR modernizes
seewavby adding continuous-integration, full type-hints, stricter unit-testing and a clearer, more ergonomic CLI/API.✨ Key Features & Improvements
GitHub Actions CI
pytest-cov; uploads an XML coverage artefact100% Type-annotated Public API
seewav.pynow have explicit PEP-484 annotationstests/test_signatures.py) fails the build if a public function lacks annotationsUnified Size Handling
--size WxHCLI flag (e.g.--size 640x360)-W/--widthand-H/--heightremain with defaults (480 × 300);--sizeoverrides themsize=(w, h)tupleRobust Argument Validation
seewav.parse_size_tokenhelpertests/test_arguments.py) checks:parse_size_token– valid & invalid pathsparse_color– valid & invalid RGB stringsread_audio– fails gracefully on non-audio filesvisualize– detects channel/--stereomismatchesDocumentation Updates
size=(640, 360)🛠️ Implementation Notes
.github/workflows/ci.ymlnumpy,tqdm,pytest,pytest-cov) and optionalffmpegparse_size_token(token: str) -> tuple[int, int]fatal().coveragercexcludes tests/venv;--cov-report=term-missing --cov-report=xmlin CI🔍 How to Review
seewav.pypytest -vvlocally; 27 tests including argument-validation and meta type-checking should passThis PR brings the project up to date with modern Python best-practices, increases test coverage, and lays the groundwork for future features with confidence in correctness.
Co-author: OpenAI o3 model via Codex CLI
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.