feat: Add comprehensive Python testing infrastructure #13
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 establishes a complete testing infrastructure for the CodeFuse evaluation framework, transitioning from basic requirements.txt dependency management to a modern Poetry-based setup with comprehensive testing capabilities.
Changes Made
Package Management
pyproject.toml
requirements.txt
to Poetry formatpytest
,pytest-cov
,pytest-mock
as dev dependenciesTesting Configuration
pyproject.toml
:unit
,integration
,slow
codefuseEval
andcodefuseEval_202503
packagesDirectory Structure
tests/
directory with proper__init__.py
filestests/unit/
andtests/integration/
subdirectories for organized testingconftest.py
with shared fixtures including:Infrastructure Validation
test_infrastructure_validation.py
) that verify:Additional Setup
.gitignore
with testing-related entries and Claude Code settingspoetry run test
andpoetry run tests
commandsDependencies
All original dependencies from
requirements.txt
have been preserved and migrated to Poetry format with appropriate version constraints compatible with Python 3.8-3.11.Key Testing Dependencies Added:
pytest ^7.4.0
- Main testing frameworkpytest-cov ^4.1.0
- Coverage reportingpytest-mock ^3.11.1
- Advanced mocking utilitiesRunning Tests
Basic Test Execution
Using Custom Markers
Coverage Reports
htmlcov/
directorycoverage.xml
Validation Results
✅ All 14 validation tests pass successfully
✅ Testing infrastructure is fully functional
✅ Fixtures and markers work correctly
✅ Coverage reporting configured properly
Next Steps
The testing infrastructure is now ready for development teams to:
tests/unit/
for individual functions and classestests/integration/
for end-to-end workflowsconftest.py
for common test data and mocksNotes
🤖 Generated with Claude Code