feat: Set up comprehensive Python testing infrastructure with Poetry#74
Open
llbbl wants to merge 1 commit intoDinoMan:masterfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#74llbbl wants to merge 1 commit intoDinoMan:masterfrom
llbbl wants to merge 1 commit intoDinoMan:masterfrom
Conversation
- Migrated from setup.py to Poetry with pyproject.toml configuration - Added pytest, pytest-cov, and pytest-mock as development dependencies - Configured pytest with coverage reporting, custom markers, and strict options - Created tests directory structure with unit/integration subdirectories - Added comprehensive test fixtures in conftest.py for common testing needs - Created validation tests to verify testing infrastructure works correctly - Updated .gitignore with testing and development-related entries - Set up Poetry scripts for running tests with `poetry run test` or `poetry run tests`
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.
Set Up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the SDA (Speech-Driven Animations) project using Poetry as the package manager and pytest as the testing framework. The setup provides a solid foundation for developers to write and run tests efficiently.
Changes Made
Package Management Migration
pyproject.tomlwith all existing dependencies migrated fromsetup.py.gitignoreto trackpoetry.lockfor reproducible buildsTesting Framework Setup
pytest(^7.4.0) - Core testing frameworkpytest-cov(^4.1.0) - Coverage reportingpytest-mock(^3.12.0) - Mocking utilitiesTesting Configuration
Pytest Configuration in
pyproject.toml:unit,integration,slowtest_*.pyand*_test.pyCoverage Configuration:
sdapackageDirectory Structure
Test Fixtures (conftest.py)
Created comprehensive fixtures for common testing needs:
temp_dir: Temporary directory managementsample_audio_data: NumPy array audio datasample_image_data: NumPy array image datasample_tensor: PyTorch tensor samplesmock_config: Configuration dictionariessample_model_weights: Model weight filessample_audio_file: WAV file creationsample_image_file: PNG file creationreset_random_seeds: Automatic seed resettinggpu_available: GPU availability checkmock_env_vars: Environment variable mockingcapture_logs: Log message capturingDevelopment Experience
poetry run testpoetry run testshtmlcov/directory andcoverage.xmlOther Changes
.pytest_cache/,.coverage,htmlcov/, etc.).claude/*)Running Tests
Install dependencies:
Run all tests:
Run specific test markers:
View coverage report:
Notes
setup.pyhave been preserved in the Poetry configurationpoetry.lockfile should be committed to ensure reproducible builds across environmentsNext Steps
Developers can now:
tests/unit/directorytests/integration/directoryconftest.pyfor common testing scenarios