feat: Add Python testing infrastructure with Poetry and pytest#128
Open
llbbl wants to merge 1 commit into
Open
feat: Add Python testing infrastructure with Poetry and pytest#128llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Configure Poetry as package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Set up test directory structure with unit/integration subdirs - Create comprehensive conftest.py with shared fixtures - Configure pytest with markers and coverage settings - Update .gitignore with testing and Poetry entries - Add validation tests to verify infrastructure works
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 complete Python testing infrastructure for the PointPillar project using Poetry for dependency management and pytest for testing. The setup provides a ready-to-use testing environment where developers can immediately start writing tests.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the primary package managerTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilespytest.iniand pyproject.toml configurationsCoverage Settings:
Directory Structure
Shared Fixtures (conftest.py)
temp_dir: Temporary directory that auto-cleans after testssample_point_cloud: Generate sample point cloud datasample_config: Provide test configuration dictionariesmock_model_path: Create mock ONNX model pathssample_bin_file: Create sample binary point cloud filesmock_yaml_config: Create YAML configuration filesdevice: Get appropriate torch device (CPU/CUDA)reset_environment: Reset env variables between testscapture_logs: Capture log messages during testsAdditional Files
How to Use
Install Dependencies
Run Tests
Writing New Tests
tests/unit/ortests/integration/conftest.py@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slowNotes
tooldirectory. Currently, validation tests don't contribute to coverage metrics.poetry.lockfile should be committed to ensure reproducible builds across environments.Validation
The setup includes validation tests that verify:
All validation tests pass successfully, confirming the testing infrastructure is ready for use.