RTS3D
RTS3D copied to clipboard
feat: set up comprehensive Python testing infrastructure
Set up comprehensive Python testing infrastructure
Summary
This PR establishes a complete testing infrastructure for the RTS3D project, providing developers with a ready-to-use environment for writing and running tests.
Changes Made
- Package Management: Set up Poetry as the package manager with
pyproject.tomlconfiguration - Dependency Migration: Migrated existing dependencies from
requirements.txtto Poetry format - Testing Dependencies: Added pytest, pytest-cov, and pytest-mock as development dependencies
- Test Configuration: Configured comprehensive pytest settings including:
- Custom test markers:
unit,integration,slow - Coverage reporting with 80% threshold
- HTML and XML coverage report generation
- Strict configuration for reliable test runs
- Custom test markers:
- Directory Structure: Created organized test directories:
tests/- Main test directorytests/unit/- Unit teststests/integration/- Integration tests
- Shared Fixtures: Added comprehensive
conftest.pywith fixtures for:- Temporary directories and files
- Mock models and configurations
- Sample KITTI data structures
- Environment cleanup
- Infrastructure Validation: Created validation test suite to verify setup
- Git Configuration: Updated
.gitignorewith testing artifacts and Claude Code settings
Running Tests
Basic Commands
# Install dependencies
poetry install
# Run all tests
poetry run pytest
# Run tests with coverage
poetry run pytest --cov=src --cov-report=html
# Run specific test types
poetry run pytest -m unit # Unit tests only
poetry run pytest -m integration # Integration tests only
poetry run pytest -m slow # Slow tests only
Coverage Reports
- HTML reports:
htmlcov/index.html - XML reports:
coverage.xml - Console output with missing line numbers
Configuration Notes
- Python Version: Requires Python 3.8+
- Coverage Threshold: Set to 80% (configurable in
pyproject.toml) - Excluded from Coverage: External libraries, setup files, CUDA extensions
- Test Discovery: Follows pytest conventions (
test_*.py,*_test.py)
Next Steps
Developers can now:
- Write unit tests in
tests/unit/ - Write integration tests in
tests/integration/ - Use shared fixtures from
conftest.py - Run tests with coverage reporting
- Use custom markers to organize test execution
The validation tests confirm all infrastructure components are working correctly.