feat: Add comprehensive Python testing infrastructure with Poetry#73
Open
llbbl wants to merge 1 commit into
Open
feat: Add comprehensive Python testing infrastructure with Poetry#73llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Set up Poetry package management with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as development dependencies - Configure pytest with markers for unit, integration, and slow tests - Set up coverage reporting with 80% threshold and multiple output formats - Create test directory structure with proper __init__.py files - Add comprehensive conftest.py with shared fixtures for testing - Update .gitignore with testing and Claude-specific entries - Create infrastructure validation tests to ensure setup works correctly
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 establishes a comprehensive testing infrastructure for the FastDepth project using Poetry as the package manager and pytest as the testing framework. The setup provides a ready-to-use environment where developers can immediately start writing tests with proper tooling, configuration, and shared fixtures.
Changes Made
Package Management
pyproject.tomlwith Poetry as the package managerTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilesunit,integration, andslowCoverage Configuration:
htmlcov/Directory Structure
Shared Fixtures (conftest.py)
temp_dir: Temporary directory for test filesmock_config: Mock configuration objectsample_rgb_image: Sample RGB image arraysample_depth_map: Sample depth map arraysample_batch: PyTorch batch datamock_model: Mock PyTorch modelmock_dataloader: Mock dataloaderdevice: PyTorch device selectionmock_checkpoint: Mock checkpoint filemock_hdf5_file: Mock HDF5 data filereset_torch_state: Auto-cleanup for PyTorchcapture_stdout: Stdout capture utilityOther Updates
Running Tests
Install Dependencies
Run All Tests
Run Tests with Options
View Coverage Report
After running tests, open
htmlcov/index.htmlin a browser to view the detailed coverage report.Notes
poetry run testandpoetry run testscommands are available (though currently simplified to use pytest directly)Next Steps
Developers can now:
tests/unit/tests/integration/