feat: Set up comprehensive Python testing infrastructure with Poetry #19
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 comprehensive Python testing infrastructure with Poetry
Summary
This PR establishes a complete testing infrastructure for the shiftpi project, migrating from Python 2.7 to Python 3.11 and setting up Poetry as the package manager with comprehensive testing capabilities.
Changes Made
Package Management
pyproject.tomliteritems()withitems())Testing Infrastructure
pytest ^7.4.0- Main testing frameworkpytest-cov ^4.1.0- Coverage reportingpytest-mock ^3.11.0- Mocking utilitiesTesting Configuration
unit,integration,slowDirectory Structure
Fixtures and Mocking
conftest.py:temp_dir- Temporary directory for testsmock_gpio- RPi.GPIO mocking for testing without hardwaremock_config- Sample configuration datasample_pin_states- Test pin state datareset_shiftpi_globals- Clean global state between teststemp_file- Temporary file fixturemock_sleep- Mock time.sleep for faster testsDevelopment Workflow
poetry run test- Run all testspoetry run tests- Alternative command (both work).pytest_cache/,.coverage,htmlcov/)build/,dist/,*.egg-info/).claude/*)Testing Instructions
Installation
Running Tests
Coverage Reports
Coverage reports are generated in multiple formats:
htmlcov/index.htmlfor detailed browser viewingcoverage.xmlfor CI/CD integrationValidation
The setup has been validated with comprehensive tests that verify:
Notes
poetry.lockis tracked in version control as intendedThe testing infrastructure is now ready for developers to start writing comprehensive unit and integration tests for the shiftpi library.
🤖 Generated with Claude Code