feat: Add complete Python testing infrastructure with Poetry#518
Open
llbbl wants to merge 1 commit intomlbvn:mainfrom
Open
feat: Add complete Python testing infrastructure with Poetry#518llbbl wants to merge 1 commit intomlbvn:mainfrom
llbbl wants to merge 1 commit intomlbvn:mainfrom
Conversation
- Set up Poetry as package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting (80% threshold) - Create test directory structure with unit/integration folders - Add comprehensive shared fixtures in conftest.py - Update .gitignore with testing and Claude-related entries - Add validation tests to verify infrastructure setup - Configure custom test markers (unit, integration, slow) - Set up Poetry scripts for running tests
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.
Add Python Testing Infrastructure
Summary
This PR establishes a complete testing infrastructure for the Machine Learning Yearning translation project. It introduces Poetry as the package manager and sets up pytest with comprehensive configuration for unit and integration testing.
Changes Made
Package Management
pyproject.tomlwith Poetry setup, migrating from Dockerfile dependenciespdfkit(^1.0.0),grip(4.5.2)pytest(^7.4.3),pytest-cov(^4.1.0),pytest-mock(^3.12.0)Testing Setup
Directory Structure:
Pytest Configuration:
@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowShared Fixtures (in
conftest.py):temp_dir: Temporary directory managementsample_markdown_content: Test markdown contentsample_chapter_file: Mock chapter filesmock_chapters_dir: Mock chapters directorymock_imgs_dir: Mock images directorymock_project_structure: Complete mock projectenv_vars: Test environment variablesmock_pdf_config: PDF configurationcleanup_test_files: Automatic test file cleanupAdditional Updates
.gitignore: Added comprehensive entries for:Running Tests
Install Dependencies
Run All Tests
Run Specific Test Types
Coverage Reports
htmlcov/index.htmlcoverage.xmlNotes
package-mode = false