feat: Set up comprehensive Python testing infrastructure with Poetry #42
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.
Set Up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the hymm video generation project, migrating from basic pip requirements to Poetry for modern dependency management and setting up pytest with full coverage reporting.
Changes Made
Package Management Migration
pyproject.tomlwith Poetry configurationrequirements.txtto PoetryTesting Framework Setup
pytest-covfor coverage reportingpytest-mockfor mocking utilitiesunit,integration,slowTest Directory Structure
Shared Test Fixtures (conftest.py)
temp_dir: Temporary directory managementmock_config: Configuration dictionary for testingsample_image_array: 224x224x3 RGB test imagesample_video_frames: 10 frames of 128x128x3 videosample_audio_array: 1-second audio signal at 16kHztest_data_dir: Test directory with sample filesenv_vars: Environment variable managementcapture_logs: Log message assertion helpertest_helpers: Utility methods for array assertionsDevelopment Experience
poetry run testorpoetry run testsRunning Tests
Install dependencies:
Run all tests with coverage:
Run tests without coverage:
Run specific test markers:
poetry run pytest -m unit poetry run pytest -m integration poetry run pytest -m "not slow"View coverage report:
htmlcov/index.htmlin browsercoverage.xmlfor CI integrationNotes
poetry.lockfile is committed to ensure reproducible buildsNext Steps
hymm_sp/