feat: Add comprehensive Python testing infrastructure with Poetry #3
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.
Add Comprehensive Python Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the FSDP optimizers project, providing a ready-to-use testing environment for developers.
Changes Made
Package Management
pyproject.tomlwith complete project metadatasetup.pyto Poetry formatTesting Framework Setup
pytest,pytest-cov,pytest-mockpyproject.tomlwith:unit,integration,slowDirectory Structure
Created complete testing directory structure:
Testing Configuration
conftest.pyincluding:temp_dir: Temporary directory managementmock_config: Mock configuration objectssample_tensor: Sample PyTorch tensorssample_model: Simple neural network modelsoptimizer_params: Standard optimizer parametersrandom_seed: Reproducible random statemock_fsdp_model: Mock FSDP modelsInfrastructure Improvements
.gitignorewith comprehensive Python exclusionsRunning Tests
Install Dependencies
Run All Tests
Run Tests by Category
Coverage Reports
Validation
The setup includes validation tests that verify:
Notes
poetry.lockis tracked in git for reproducible buildspyproject.tomlThis infrastructure provides a solid foundation for test-driven development and maintains high code quality standards.