Skip to content

feat: set up comprehensive Python testing infrastructure - #7

Open
llbbl wants to merge 1 commit into
Banconxuan:mainfrom
UnitSeeker:add-testing-infrastructure
Open

feat: set up comprehensive Python testing infrastructure#7
llbbl wants to merge 1 commit into
Banconxuan:mainfrom
UnitSeeker:add-testing-infrastructure

Conversation

@llbbl

@llbbl llbbl commented Sep 4, 2025

Copy link
Copy Markdown

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.toml configuration
  • Dependency Migration: Migrated existing dependencies from requirements.txt to 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
  • Directory Structure: Created organized test directories:
    • tests/ - Main test directory
    • tests/unit/ - Unit tests
    • tests/integration/ - Integration tests
  • Shared Fixtures: Added comprehensive conftest.py with 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 .gitignore with 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:

  1. Write unit tests in tests/unit/
  2. Write integration tests in tests/integration/
  3. Use shared fixtures from conftest.py
  4. Run tests with coverage reporting
  5. Use custom markers to organize test execution

The validation tests confirm all infrastructure components are working correctly.

- Set up Poetry package management with pyproject.toml configuration
- Migrated existing dependencies from requirements.txt to Poetry format
- Added pytest, pytest-cov, and pytest-mock as development dependencies
- Configured pytest with custom markers (unit, integration, slow)
- Set up coverage reporting with 80% threshold and HTML/XML output
- Created testing directory structure with tests/unit/ and tests/integration/
- Added comprehensive conftest.py with shared fixtures for CV/ML testing
- Created validation test suite to verify infrastructure setup
- Updated .gitignore with testing artifacts and Claude Code settings

This establishes a ready-to-use testing environment for the RTS3D project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant