feat: add comprehensive Python testing infrastructure with Poetry #7
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 complete testing infrastructure for the video-depixelation project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationpoetry.lockfor reproducible buildsTesting Framework
Project Structure
Configuration
pytest Configuration (
pyproject.toml)unit,integration,slow,gpuCoverage Settings
v1/andv2/htmlcov/Fixtures (
conftest.py)temp_dir: Temporary directory with automatic cleanupmock_config: Configuration dictionary for testingsample_image: PIL Image creationsample_tensor: PyTorch tensor creationmock_frames_folder: Sample video frames setupoutput_folders: All project output directoriesdevice: CPU/CUDA device selectioncleanup_cuda: Automatic CUDA cache cleanupDevelopment Workflow
Running Tests
Coverage Reports
Additional Updates
.gitignore: Added entries for testing artifacts, coverage reports, Python caches, virtual environments, and IDE filesDependencies Added
Production Dependencies
torch ^2.0.0torchvision ^0.15.0pillow ^10.0.0Development Dependencies
pytest ^7.4.0pytest-cov ^4.1.0pytest-mock ^3.11.0Next Steps
Testing the Setup
The infrastructure has been validated with 18 passing tests that verify:
Run
poetry run pytestto see the validation tests in action.