feat: Set up comprehensive Python testing infrastructure with Poetry#44
Open
llbbl wants to merge 1 commit into
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#44llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Migrate from setup.py to Poetry package management in pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting (80% threshold) - Create test directory structure with unit/integration separation - Add comprehensive shared fixtures in conftest.py - Configure custom pytest markers (unit, integration, slow) - Update .gitignore with testing and Claude-specific entries - Add Poetry script commands for running tests - Create validation tests to verify infrastructure setup
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 speechmetrics project, migrating from
setup.pyto Poetry for modern dependency management and adding pytest with coverage reporting.Changes Made
Package Management Migration
pyproject.tomlwith Poetry configurationsetup.pyto Poetry formatTesting Setup
Configuration
pytest configuration in
pyproject.toml:tests/directoryunit,integration,slowCoverage configuration:
speechmetrics__init__.py, setup filesDirectory Structure
Shared Fixtures (conftest.py)
temp_dir: Temporary directory managementsample_audio_data: Generate test audio arrayssample_rate: Standard 16kHz sample ratemock_config: Configuration dictionary for testingexample_wav_file: Create temporary WAV filesreset_environment: Environment variable isolationmock_tensorflow: TensorFlow mocking for faster testsnoisy_audio_pair: Clean/noisy audio pair generationPoetry Scripts
poetry run test- Run all testspoetry run tests- Alternative command (both work).gitignore Updates
.pytest_cache/,.coverage,htmlcov/,coverage.xml.claude/*poetry.lockis intentionally NOT ignored (should be committed)How to Use
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -Install dependencies:
Run tests:
Run specific test types:
View coverage report:
Notes
Next Steps
Developers can now:
tests/unit/tests/integration/