feat: Add comprehensive Python testing infrastructure#13
Open
llbbl wants to merge 1 commit intocodefuse-ai:masterfrom
Open
feat: Add comprehensive Python testing infrastructure#13llbbl wants to merge 1 commit intocodefuse-ai:masterfrom
llbbl wants to merge 1 commit intocodefuse-ai:masterfrom
Conversation
- Set up Poetry package manager with pyproject.toml configuration - Migrated all dependencies from requirements.txt to Poetry format - Added pytest, pytest-cov, and pytest-mock as test dependencies - Configured pytest with 80% coverage threshold and custom markers - Created tests/ directory structure with unit/ and integration/ subdirs - Added comprehensive conftest.py with shared fixtures for testing - Updated .gitignore with Claude Code settings - Included validation tests to verify infrastructure functionality - Configured coverage reporting with HTML, XML, and console output
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.
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.tomlrequirements.txtto Poetry formatpytest,pytest-cov,pytest-mockas dev dependenciesTesting Configuration
pyproject.toml:unit,integration,slowcodefuseEvalandcodefuseEval_202503packagesDirectory Structure
tests/directory with proper__init__.pyfilestests/unit/andtests/integration/subdirectories for organized testingconftest.pywith shared fixtures including:Infrastructure Validation
test_infrastructure_validation.py) that verify:Additional Setup
.gitignorewith testing-related entries and Claude Code settingspoetry run testandpoetry run testscommandsDependencies
All original dependencies from
requirements.txthave 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.xmlValidation 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.pyfor common test data and mocksNotes
🤖 Generated with Claude Code