feat: Set up comprehensive Python testing infrastructure with Poetry#4
Open
llbbl wants to merge 1 commit into
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#4llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Configure Poetry package manager with pyproject.toml - Add testing dependencies: pytest, pytest-cov, pytest-mock - Set up pytest configuration with coverage reporting (80% threshold) - Create testing directory structure with unit/integration separation - Add shared fixtures in conftest.py for common test utilities - Configure custom pytest markers (unit, integration, slow) - Update .gitignore with testing-related entries - Create validation tests to verify infrastructure works correctly
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 STFT Transformer project using Poetry as the package manager. The setup provides a ready-to-use testing environment where developers can immediately start writing and running tests.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationpytest(main testing framework)pytest-cov(coverage reporting with 80% threshold)pytest-mock(mocking utilities)Testing Configuration
unit,integration, andslowfor test categorizationDirectory Structure
Shared Fixtures (
conftest.py)temp_dir: Temporary directory managementsample_audio_data: Mock audio data for testingsample_metadata_df: Sample pandas DataFramemock_config: Configuration dictionarysample_paths: Directory structure setupmock_numpy_array&mock_spectrogram: ML testing utilitiesAdditional Setup
.gitignore: Comprehensive Python project gitignore with testing entriesRunning Tests
Basic Commands
Test Organization
/tests/unit/- Fast, isolated component tests/tests/integration/- Cross-component interaction tests@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowCoverage Reporting
Dependencies Notes
^3.9for modern dependency compatibilityaudiomentationswas excluded due to version conflicts - can be added manually if neededpoetry.lockcreated and should be committed (not in .gitignore)Validation Results
✅ All 10 validation tests pass
✅ Coverage reporting works correctly
✅ Custom markers function properly
✅ Fixtures are available and functional
✅ Mock utilities integrated successfully
The testing infrastructure is now ready for development. Developers can immediately begin writing tests following the established patterns and conventions.