feat: Add comprehensive Python testing infrastructure with Poetry#81
Open
llbbl wants to merge 1 commit intolmb-freiburg:masterfrom
Open
feat: Add comprehensive Python testing infrastructure with Poetry#81llbbl wants to merge 1 commit intolmb-freiburg:masterfrom
llbbl wants to merge 1 commit intolmb-freiburg:masterfrom
Conversation
- Set up Poetry as package manager with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with markers (unit, integration, slow) and coverage reporting - Create test directory structure with shared fixtures in conftest.py - Update .gitignore with testing and development patterns - Add validation tests to verify testing 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 DeMoN (Depth Motion Network) project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the project's package managerTesting Configuration
Pytest Configuration: Configured pytest with:
test_*.pyand*_test.pyfilesunit,integration, andslowCoverage Configuration: Set up coverage.py with:
python/depthmotionnetDirectory Structure
Shared Fixtures (conftest.py)
Created comprehensive fixtures for common testing needs:
temp_dir: Temporary directory managementmock_config: Mock configuration objectsample_image_pair: Creates test image pairssample_depth_map: Generates test depth mapssample_camera_matrix: Provides test camera intrinsicssample_rotation_translation: Test transformation matricesreset_tensorflow: Clears TF session between testsmock_dataset: Creates mock dataset structurecapture_stdout: Captures print output for testingDevelopment Commands
Both
poetry run testandpoetry run testsare configured to run the test suite with all pytest options available.Additional Updates
How to Use
Install dependencies:
Run all tests:
Run specific test markers:
Run with coverage:
Coverage is automatically generated when running tests. View reports:
htmlcov/index.htmlin a browsercoverage.xmlfor CI integrationValidation
The setup includes validation tests in
test_setup_validation.pythat verify:All validation tests pass successfully, confirming the testing infrastructure is ready for use.
Next Steps
Developers can now:
tests/unit/directorytests/integration/directory