feat: Set up comprehensive Python testing infrastructure #6
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 Python Testing Infrastructure
Summary
This PR sets up a comprehensive testing infrastructure for the Extra Image List Blender addon, providing a complete development environment for writing and running tests.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration for dependency managementpytest,pytest-cov, andpytest-mockas development dependenciesTesting Configuration
pyproject.tomlincluding:test_*.pyand*_test.pyfilesunit,integration, andslowCoverage Reporting
htmlcov/), XML (coverage.xml), and terminal outputDirectory Structure
Shared Fixtures (conftest.py)
temp_dirandtemp_filefixtures for test isolationbpymodule and Blender contextsDevelopment Workflow
poetry run pytestpoetry run pytest --covpoetry run pytest -m "unit"poetry run pytest -m "not slow"htmlcov/Git Integration
Testing Infrastructure Validation
The setup includes a comprehensive validation test suite (
test_setup_validation.py) that verifies:✅ Basic pytest functionality (assertions, parametrized tests)
✅ All fixtures work correctly (temp files, Blender mocks, test data)
✅ Mocking capabilities (unittest.mock, patches, MagicMock)
✅ Test markers function (unit, integration, slow)
✅ Coverage reporting (branch coverage, exclusions)
✅ Error handling (exception testing, message validation)
✅ Data-driven testing (parametrized test cases)
Test Results: 31 tests pass, demonstrating that all infrastructure components are working correctly.
Usage Instructions
Initial Setup
Coverage Reports
htmlcov/index.htmlin browser for detailed coveragecoverage.xmlfor CI/CD integrationWriting Tests
tests/unit/for fast, isolated teststests/integration/for tests with dependenciesconftest.pyfor common test data@pytest.mark.slowfor tests that take significant timeNotes
bpymodule mocking[tool.poetry.group.test]section🤖 Generated with Claude Code