feat: Set up comprehensive Python testing infrastructure with Poetry#4
Open
llbbl wants to merge 1 commit intoSkyworkAI:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#4llbbl wants to merge 1 commit intoSkyworkAI:mainfrom
llbbl wants to merge 1 commit intoSkyworkAI:mainfrom
Conversation
- Initialize Poetry as package manager with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as development dependencies - Configure pytest with coverage thresholds, markers, and reporting - Create testing directory structure with unit/integration separation - Add shared fixtures in conftest.py for common testing needs - Update .gitignore with testing and Claude-specific entries - Add validation tests to verify testing setup functionality
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 MoE++ Python project, providing developers with a ready-to-use testing environment powered by Poetry and pytest.
Changes Made
Package Management
pyproject.tomlwith project metadata and dependenciespoetry.lockfile for reproducible buildsTesting Dependencies
Added the following development dependencies:
Testing Configuration
pytest Configuration (
pyproject.toml)tests/directoryunit,integration,slowCoverage Configuration
MoE++htmlcov/directoryDirectory Structure
Shared Fixtures (
conftest.py)temp_dir- Temporary directory managementmock_config- Sample configuration for testingsample_data- Test data setsenv_vars- Environment variable managementreset_modules- Module state cleanupmock_file_system- File system mockingcapture_logs- Log capture utilitiesDevelopment Commands
Both commands are available and execute pytest:
poetry run test- Run all testspoetry run tests- Alternative commandGit Configuration
Updated
.gitignorewith:.claude/*)poetry.lockis NOT ignored (best practice)How to Use
Install dependencies:
Run all tests:
Run specific tests:
View coverage report:
htmlcov/index.htmlin browsercoverage.xmlfor CI toolsValidation
The setup includes
test_setup_validation.pywhich verifies:All validation tests pass successfully, confirming the infrastructure is ready for use.
Notes