feat: Set up comprehensive Python testing infrastructure#19
Open
llbbl wants to merge 1 commit intoAI4Bharat:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure#19llbbl wants to merge 1 commit intoAI4Bharat:mainfrom
llbbl wants to merge 1 commit intoAI4Bharat:mainfrom
Conversation
- Add Poetry configuration with migrated dependencies from requirements.txt - Configure pytest with coverage reporting, custom markers, and strict options - Create testing directory structure with unit/integration subdirectories - Add comprehensive conftest.py with shared fixtures for testing - Include validation tests to verify testing infrastructure functionality - Update .gitignore with Claude Code settings
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 Complete Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the IndicCrop project, providing a robust foundation for test-driven development and continuous integration.
Changes Made
Package Management & Dependencies
pyproject.tomlwith Poetry configurationrequirements.txtto Poetry format with flexible version constraintspytest,pytest-cov,pytest-mockas development dependenciespoetry run testandpoetry run testscommands availableTesting Configuration
pyproject.toml:test_*.pyand*_test.pyunit,integration,slowCoverage Configuration
htmlcov/), XML (coverage.xml)Directory Structure
Test Fixtures & Utilities
conftest.pywith shared fixtures:temp_dir: Temporary directory managementsample_config: Mock configuration datamock_transformers_model: Mocked transformer modelsmock_tokenizer: Mocked tokenizer functionalitysample_text_data: Multilingual sample datasample_dataset_dict: Dataset structure fixturesreset_random_seeds: Reproducible test runsValidation & Quality Assurance
test_setup_validation.py):Additional Improvements
.gitignorewith Claude Code settings (.claude/*)How to Run Tests
Basic Testing
Marker-Based Testing
Coverage Reporting
Validation Results
All validation tests pass successfully:
unit,integration,slow) working correctlyNext Steps
The testing infrastructure is now ready for development. Developers can:
tests/unit/tests/integration/conftest.pyfor common testing patternsNotes
^x.y.z) for better dependency resolution