feat: Add complete Python testing infrastructure with Poetry#26
Open
llbbl wants to merge 1 commit intoPRIS-CV:masterfrom
Open
feat: Add complete Python testing infrastructure with Poetry#26llbbl wants to merge 1 commit intoPRIS-CV:masterfrom
llbbl wants to merge 1 commit intoPRIS-CV:masterfrom
Conversation
- Set up Poetry as package manager with pyproject.toml - Configure pytest with coverage reporting and custom markers - Create test directory structure with unit/integration separation - Add comprehensive pytest fixtures in conftest.py - Configure 80% coverage threshold and reporting formats - Add .gitignore with testing and Python patterns - Create CLAUDE.md with testing instructions - Add validation tests to verify infrastructure setup
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 Complete Python Testing Infrastructure
Summary
This PR sets up a comprehensive testing infrastructure for the ResNet project using Poetry as the package manager and pytest as the testing framework. The setup provides a solid foundation for writing and maintaining tests with proper coverage reporting and test organization.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the project's package managerpoetry run testandpoetry run testscommands for running testsTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilesunit,integration, andslowfor test categorizationCoverage Configuration:
Directory Structure
Fixtures and Testing Utilities
Created comprehensive fixtures in
conftest.py:temp_dir: Temporary directory managementsample_image_path: Mock image file creationmock_model_config: Model configuration for testingmock_dataset_config: Dataset configuration for testingdevice: PyTorch device selectionsample_tensor&sample_batch: Test data generationreset_random_seeds: Reproducibility fixturemock_checkpoint: Model checkpoint creationenvironment_setup: Environment variable managementAdditional Files
.gitignore: Comprehensive Python gitignore with testing artifacts, IDE files, and project-specific patternsCLAUDE.md: Documentation for Claude AI with testing commands and project structureHow to Use
Install dependencies:
Run tests:
View coverage reports:
htmlcov/index.htmlin browsercoverage.xmlfor CI integrationNext Steps
With this infrastructure in place, developers can now:
Notes
pyproject.toml