feat: Set up Python testing infrastructure with Poetry and pytest - #96
Open
llbbl wants to merge 1 commit into
Open
feat: Set up Python testing infrastructure with Poetry and pytest#96llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Configure Poetry as package manager with pyproject.toml - Add testing dependencies: pytest, pytest-cov, pytest-mock - Set up comprehensive pytest configuration with coverage thresholds - Create testing directory structure (tests/unit, tests/integration) - Configure coverage reporting (HTML, XML, terminal) - Add pytest markers for unit, integration, and slow tests - Create shared fixtures in conftest.py for common testing needs - Update .gitignore with testing and Claude-related patterns - Add numpy as project dependency - 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.
Python Testing Infrastructure Setup
Summary
This PR sets up a comprehensive testing infrastructure for the Python project using Poetry as the package manager and pytest as the testing framework. The setup provides a solid foundation for writing and maintaining tests with proper organization, coverage reporting, and development tooling.
Changes Made
Package Management
pyproject.tomlTesting Framework Setup
pytest Configuration:
unit,integration,slowCoverage Configuration:
Directory Structure
Testing Fixtures (conftest.py)
Created comprehensive shared fixtures for common testing needs:
temp_dirandtemp_file: Temporary file/directory managementmock_config: Mock configuration objectssample_data: Sample numpy data generationmock_dataset: Mock dataset for ML testingnumpy_array_fixture: Common numpy arraystorch_tensor_fixture: PyTorch tensors (when available)reset_random_seeds: Reproducible test runscapture_stdout: Output capture for testing print statementsmock_file_operations: Mock file I/O operationstime_tracker: Performance measurementDevelopment Experience
poetry run testandpoetry run testscommandsHow to Use
Install dependencies:
Run tests:
Run specific test markers:
View coverage reports:
htmlcov/index.htmlafter running testscoverage.xmlfor CI integrationValidation
The setup includes validation tests that verify:
All validation tests pass successfully.
Notes
src/train_torch_filter.pythat should be addressed separately