feat: Set up comprehensive Python testing infrastructure#3
Open
feat: Set up comprehensive Python testing infrastructure#3
Conversation
- Add Poetry package manager with pyproject.toml configuration - Install pytest, pytest-cov, and pytest-mock as testing dependencies - Configure pytest with custom markers (unit, integration, slow) and coverage settings - Create organized testing directory structure (tests/, unit/, integration/) - Add comprehensive conftest.py with reusable fixtures for temp files, mocks, and email testing - Update .gitignore with testing artifacts, virtual environments, and IDE files - Include validation tests to verify infrastructure setup works correctly - Set 80% coverage threshold with HTML and XML reporting
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.
Set up comprehensive Python testing infrastructure
Summary
This PR establishes a complete testing infrastructure for the davemail Python project, providing developers with a ready-to-use environment for writing and running tests.
Changes Made
Package Management
pyproject.tomlwith Poetry as the package managerTesting Configuration
pyproject.tomlincluding:@pytest.mark.unit- Unit tests@pytest.mark.integration- Integration tests@pytest.mark.slow- Slow-running testsDirectory Structure
Testing Fixtures & Utilities
conftest.pywith fixtures for:Project Configuration
Validation
How to Run Tests
Basic Test Commands
Coverage Reports
Test Discovery
Pytest will automatically discover tests following these patterns:
test_*.py,*_test.pyTest*test_*Dependencies Added
Production Dependencies
configobj ^5.0- Configuration file parsingnotmuch *- Email indexing and searchDevelopment Dependencies
pytest ^7.4.0- Testing frameworkpytest-cov ^4.1.0- Coverage reportingpytest-mock ^3.11.0- Mocking utilitiesNotes
poetry.lockis tracked in git for reproducible buildsThe testing infrastructure is now fully functional and ready for use. All validation tests pass, confirming the setup is working correctly.