feat: Set up comprehensive Python testing infrastructure#40
Open
llbbl wants to merge 1 commit intoitsfoss:masterfrom
Open
feat: Set up comprehensive Python testing infrastructure#40llbbl wants to merge 1 commit intoitsfoss:masterfrom
llbbl wants to merge 1 commit intoitsfoss:masterfrom
Conversation
- Migrated from requirements.txt to Poetry package management - Added pytest, pytest-cov, and pytest-mock as test dependencies - Configured pytest with 80% coverage threshold and HTML/XML reports - Created tests/ directory structure with unit/ and integration/ subdirectories - Added comprehensive conftest.py with shared fixtures for testing - Set up custom pytest markers (unit, integration, slow) - Updated .gitignore with testing-related entries and Claude Code settings - Added validation tests to verify infrastructure setup - Generated coverage reports in HTML and XML formats
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 PDF Compressor project, migrating from a simple
requirements.txtsetup to a professional Poetry-based development environment with comprehensive testing capabilities.Changes Made
requirements.txtto Poetry withpyproject.tomlconfigurationpytest,pytest-cov, andpytest-mockas development dependenciesunit,integration, andslowtestsconftest.pywith reusable test fixtures:temp_dir: Temporary directory for test filessample_pdf_path: Mock PDF files for testingmock_qapplication: PyQt application mockingmock_subprocess: Subprocess command mockingcompression_test_data: Test data for compression operations.gitignorewith testing-related entries and IDE configurationsTesting Infrastructure Components
pytest Configuration (
pyproject.toml):Coverage Configuration:
src/)Shared Test Fixtures (
tests/conftest.py):Running Tests
After this setup, developers can run tests using:
Coverage Reports
The setup generates coverage reports in multiple formats:
htmlcov/index.html- Interactive coverage reportcoverage.xml- For CI/CD integrationDependencies Migration
Before:
requirements.txtAfter:
pyproject.tomlwith PoetryPyQt6,humanizepytest,pytest-cov,pytest-mockNext Steps
This infrastructure is ready for developers to:
The validation tests confirm that all fixtures, markers, and coverage reporting work correctly. The setup follows Python testing best practices and provides a solid foundation for comprehensive test coverage.