feat: Set up comprehensive Python testing infrastructure with Poetry#12
Open
llbbl wants to merge 1 commit intoyoheinakajima:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#12llbbl wants to merge 1 commit intoyoheinakajima:mainfrom
llbbl wants to merge 1 commit intoyoheinakajima:mainfrom
Conversation
- Add Poetry as package manager with pyproject.toml configuration - Migrate all dependencies from requirements.txt to Poetry - Add testing dependencies: pytest, pytest-cov, pytest-mock - Configure pytest with custom markers and coverage thresholds - Create testing directory structure with unit/integration folders - Add comprehensive shared fixtures in conftest.py - Update .gitignore with testing and Claude-specific entries - Add validation tests to verify infrastructure setup
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 sets up a comprehensive testing infrastructure for the Flask application builder project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the package managerrequirements.txtto Poetry formatTesting Setup
Configuration
pytest Configuration in
pyproject.toml:unit,integration,slowCoverage Configuration:
Development Experience
testandtestscommands for running pytestconftest.py:temp_dir: Temporary directory managementmock_env_vars: Environment variable mockingsample_config: Test configuration dataflask_app&flask_client: Flask testing utilitiesmock_file_operations: File operation mockingOther Changes
.gitignore: Comprehensive Python gitignore with testing artifacts and Claude-specific entriestest_setup_validation.pyto verify the infrastructure setupHow to Use
Install dependencies:
Run tests:
Run tests with specific markers:
poetry run pytest -m unit poetry run pytest -m integration poetry run pytest -m "not slow"Run tests without coverage (useful during development):
View coverage report:
htmlcov/index.htmlin a browsercoverage.xmlfor CI integrationNotes
poetry.lock) should be committed to ensure reproducible buildsNext Steps
Developers can now immediately start writing tests for the Flask application by:
tests/unit/tests/integration/conftest.py