feat: Set up Python testing infrastructure with Poetry #426
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 establishes a complete Python testing infrastructure for the project using Poetry as the package manager and pytest as the testing framework.
Changes Made
pyproject.toml
with Poetry configuration set to package-mode disabled (appropriate for non-Python package projects)pytest
(v7.4.0+) - Main testing frameworkpytest-cov
(v4.1.0+) - Coverage reportingpytest-mock
(v3.11.1+) - Mocking utilitiesunit
,integration
, andslow
testsconftest.py
:temp_dir
andtemp_file
for file system testingmock_env_vars
for environment variable mockingsample_config
,sample_yaml_content
,sample_json_content
for test dataproject_root
,charts_dir
,manifests_dir
)test_infrastructure.py
to verify the setup works correctlypoetry run pytest
)Testing Infrastructure Components
Running Tests
Coverage Reporting
htmlcov/
coverage.xml
)Custom Test Markers
@pytest.mark.unit
- Unit tests@pytest.mark.integration
- Integration tests@pytest.mark.slow
- Long-running testsValidation
✅ All validation tests pass (14/14)
✅ Poetry dependencies install successfully
✅ pytest configuration loads without errors
✅ Coverage reporting generates properly
✅ Project structure fixtures work correctly
✅ Custom markers are recognized
Next Steps
Developers can now immediately start writing tests using the established infrastructure:
tests/unit/
directorytests/integration/
directorytests/conftest.py
--cov-fail-under
inpyproject.toml
as codebase growsThe infrastructure is ready for immediate use with comprehensive fixtures, proper configuration, and validation that ensures everything works correctly.