feat: Add comprehensive Python testing infrastructure with Poetry #137
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 to RenderPipeline
Summary
This PR establishes a comprehensive testing infrastructure for the RenderPipeline project using modern Python tooling. The setup enables developers to immediately start writing tests with proper dependency management, test discovery, and coverage reporting.
Changes Made
Package Management
pyproject.toml
with Poetry setup in package-mode=false (dependency management only)Testing Configuration
pytest Configuration:
test_*.py
and*_test.py
filesunit
,integration
,slow
Coverage Settings:
rpcore
,rpplugins
,rplibs
Test Infrastructure
Directory Structure:
Shared Fixtures (in
conftest.py
):temp_dir
: Temporary directory managementmock_panda3d
: Mock Panda3D modules for testing without installationsample_config
: Sample configuration dictionariesconfig_file
: Temporary YAML config filesmock_render_pipeline
: Mock RenderPipeline instancemock_light
,mock_plugin
,mock_texture
: Common mock objectssample_shader_code
: Sample GLSL shader codecapture_logs
: Log capture utilityAdditional Updates
.gitignore
Updates: Added patterns for:.pytest_cache/
,.coverage
,htmlcov/
, etc.).claude/*
)How to Use
Installation
Running Tests
Writing Tests
tests/unit/
ortests/integration/
conftest.py
Notes
rplibs/
, which are included in the coverage reportsFuture Improvements