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 establishes a comprehensive testing infrastructure for the DCF77 MutterUhr project, providing a solid foundation for writing and running tests in a Python development environment.
Changes Made
Package Management
pyproject.tomlwith project metadata and dependenciespytest,pytest-cov,pytest-mockpoetry run testandpoetry run tests)Testing Configuration
unit,integration, andslowtestsDirectory Structure
Testing Utilities
conftest.py:temp_dir- Temporary directory for file system testsmock_machine_pin,mock_machine_rtc- Hardware mocking for MicroPython modulesmock_network- WiFi/network functionality mockingmock_urequests- HTTP request mockingmock_secrets- Credentials mockingmock_microdot- Web framework mockingDevelopment Environment
.gitignorewith comprehensive exclusions:.pytest_cache/,htmlcov/,.coverage)Validation
How to Run Tests
Install Dependencies
Run All Tests
Run Specific Test Categories
Generate Coverage Reports
poetry run pytest --cov-report=html # Open htmlcov/index.html in browser to view coverageNotes
main.py,webtime.py) are MicroPython-specific and excluded from standard Python coverage analysisTesting Infrastructure Validation
All validation tests pass successfully:
The testing infrastructure is now ready for active development and continuous integration workflows.