feat: Set up comprehensive Python testing infrastructure with Poetry#63
Open
llbbl wants to merge 1 commit intoOpenDriveLab:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#63llbbl wants to merge 1 commit intoOpenDriveLab:mainfrom
llbbl wants to merge 1 commit intoOpenDriveLab:mainfrom
Conversation
- Migrated from requirements.txt to Poetry for modern dependency management - Added pytest with coverage reporting and custom markers - Created test directory structure with unit/integration subdirectories - Configured pytest with 80% coverage threshold and multiple report formats - Added comprehensive test fixtures in conftest.py - Set up Poetry script commands for running tests - Updated .gitignore with testing artifacts and Claude settings - Created 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.
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