feat: Add complete Python testing infrastructure with Poetry#27
Open
llbbl wants to merge 1 commit intoHTDerekLiu:masterfrom
Open
feat: Add complete Python testing infrastructure with Poetry#27llbbl wants to merge 1 commit intoHTDerekLiu:masterfrom
llbbl wants to merge 1 commit intoHTDerekLiu:masterfrom
Conversation
- Set up Poetry as package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting (80% threshold) - Create test directory structure with unit/integration folders - Add comprehensive conftest.py with reusable fixtures - Update .gitignore with testing and development entries - Add Poetry scripts for running tests (test/tests commands) - Include validation tests to verify infrastructure setup
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 testing infrastructure for the BlenderToolbox project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationsetup.pyto Poetrypytest(^8.0.0) - Main testing frameworkpytest-cov(^5.0.0) - Coverage reportingpytest-mock(^3.14.0) - Mocking utilitiesTesting Configuration
Pytest Configuration: Added comprehensive pytest settings in
pyproject.toml:unit,integration,slowCoverage Configuration: Set up coverage.py with:
Directory Structure
Shared Fixtures (conftest.py)
Created comprehensive fixtures for common testing needs:
temp_dir: Temporary directory managementmock_blend_file,mock_obj_file,mock_ply_file,mock_stl_file: Mock 3D file formatsmock_image_file: Mock image filesmock_numpy_data: Mock numpy arrays (with fallback for when numpy isn't installed)mock_config: Sample configuration dataisolate_environment: Environment isolation for testscapture_logs: Log capturing during testsDevelopment Workflow
testandtestscommands that map to pytest.pytest_cache/,.coverage,htmlcov/, etc.).claude/*)poetry.lock)Additional Notes
test_setup_validation.pyto verify the infrastructure works correctlyHow to Use
Installation
Running Tests
Writing Tests
tests/unit/tests/integration/conftest.pyfor common test needsNext Steps
With this infrastructure in place, developers can immediately start writing tests for the BlenderToolbox functionality. The validation test (
test_setup_validation.py) demonstrates how to use the fixtures and confirms the setup is working correctly.