feat: Set up comprehensive Python testing infrastructure #8
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.
Set up Complete Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the ORACLE project, providing developers with a ready-to-use environment for writing and running tests.
Changes Made
Package Manager Setup
pyproject.tomlTesting Configuration
pyproject.toml:unit,integration,slowDirectory Structure
Shared Test Fixtures (
tests/conftest.py)temp_dir,temp_filesample_config,sample_waypointsmock_ros_node,mock_tensorflow,mock_tensorrt,mock_opencvsample_depth_image,sample_state_vectorcaptured_logs,environment_variables,mock_file_systemclean_importsto prevent test state leakageCoverage Configuration
htmlcov/), XML (coverage.xml)Project Files
Testing Infrastructure Features
Running Tests
Coverage Reporting
htmlcov/directoryCustom Test Markers
@pytest.mark.unit- Fast, isolated tests@pytest.mark.integration- Tests requiring multiple components@pytest.mark.slow- Time-consuming tests (can be skipped)Validation Results
✅ 16 validation tests passed, 1 skipped (expected - TensorFlow not installed)
✅ All fixtures working correctly
✅ Coverage reporting functional
✅ Custom markers properly configured
✅ Poetry dependency management working
Next Steps for Developers
poetry installtests/unit/andtests/integration/conftest.pyor add new ones as neededDependencies Note
The initial setup includes only core dependencies (numpy, matplotlib, scipy) to ensure stable installation. Additional project-specific dependencies from the original requirements files (TensorFlow, OpenCV, ROS packages, etc.) can be added incrementally as needed for specific test scenarios.
Configuration Files
pyproject.toml- Complete Poetry and pytest configuration.gitignore- Comprehensive exclusions for Python developmenttests/conftest.py- Shared fixtures and test utilities🤖 Generated with Claude Code