feat: Set up comprehensive Python testing infrastructure with Poetry#26
Open
llbbl wants to merge 1 commit intoThmen:masterfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#26llbbl wants to merge 1 commit intoThmen:masterfrom
llbbl wants to merge 1 commit intoThmen:masterfrom
Conversation
- Migrate from requirements.txt to Poetry package management - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting (80% threshold) - Create test directory structure with shared fixtures - Add custom test markers (unit, integration, slow) - Set up Poetry scripts for running tests - Create comprehensive .gitignore with testing entries - 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 Python Testing Infrastructure
Summary
This PR sets up a comprehensive testing infrastructure for the Video Super-Resolution project, enabling developers to write and run tests with proper tooling, coverage reporting, and modern dependency management.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration for modern Python dependency managementrequirements.txtto PoetryTesting Configuration
Pytest Configuration:
test_*.pyfilesunit,integration,slowCoverage Configuration:
codespackageDirectory Structure
Shared Fixtures (conftest.py)
temp_dir: Creates and cleans up temporary directoriessample_config: Provides sample configuration dictionariessample_yaml_config: Creates YAML configuration filessample_image: Generates test imagessample_video_frames: Creates directories with video frame sequencesmock_model_checkpoint: Creates mock checkpoint filesmock_lmdb_dataset: Creates mock LMDB dataset directoriescapture_stdout: Captures stdout for testing print statementsmock_cuda_available: Mocks CUDA availability for CPU-only testingsample_metrics: Provides sample metric dictionariesenv_setup: Sets up test environment variablesDevelopment Scripts
poetry run test: Run all testspoetry run tests: Alternative command (both work)Other Changes
__pycache__,*.pyc,.pytest_cache/)htmlcov/,coverage.xml,.coverage)venv/,.venv/).vscode/,.idea/).claude/*)*.pth,*.onnx, checkpoints/)Usage Instructions
Install Dependencies
Run Tests
View Coverage Reports
Validation Results
The testing infrastructure has been validated with 18 tests covering:
Note: Two tests failed due to missing PyTorch dependency, which is expected as it's not in the original requirements.txt. The testing infrastructure itself is fully functional.
Notes for Developers
Writing Tests:
tests/unit/tests/integration/conftest.pyCoverage Requirements:
Dependencies:
Next Steps
With this infrastructure in place, developers can now: