feat: Set up comprehensive Python testing infrastructure with Poetry #63
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 Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the VISTA project, migrating from traditional pip/requirements.txt to Poetry for modern dependency management and setting up pytest with coverage reporting.
Changes Made
Package Management
pyproject.tomlwith all dependencies fromrequirements.txtTesting Configuration
pytest configuration in
pyproject.toml:test_*.pyand*_test.pyfilesunit,integration, andslowCoverage configuration:
vwmpackage__init__.py, and common patternshtmlcov/directoryDirectory Structure
Test Fixtures (conftest.py)
temp_dir: Temporary directory for test filesmock_config: OmegaConf configuration for testingsample_tensor: Sample PyTorch tensorssample_video_tensor: Video tensors for temporal modelsmock_dataset_item: Mock dataset itemsmock_model_state: Model state dictionariesdevice: CPU/GPU device selectionmock_checkpoint_path: Checkpoint pathsreset_random_seeds: Reproducible testsmock_wandb: Mocked Weights & Biasesmock_env_vars: Test environment variablescapture_stdout: Output capture utilityAdditional Setup
.gitignorewith:.pytest_cache/,.coverage,htmlcov/,coverage.xml).claude/*)How to Use
Install Dependencies
Run Tests
Both commands work identically:
Run with Options
Coverage Reports
htmlcov/index.htmlin browsercoverage.xmlfor CI toolsNotes
pyproject.tomlopen_clip), but this doesn't affect the testing infrastructure itselfNext Steps
tests/unit/tests/integration/conftest.pyfor common test needs@pytest.mark.slowto exclude them during rapid development