feat: Add complete testing infrastructure with Poetry #12
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 Complete Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the pytools project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith complete Poetry configurationrequirements.txtto PoetryTesting Configuration
Pytest Configuration:
Coverage Settings:
Project Structure
Shared Fixtures (conftest.py)
temp_dir- Temporary directory managementtemp_file- Temporary file creationmock_config- Mock configuration datamock_json_file- JSON file fixturesmock_response- HTTP response mockingmock_qt_app- PyQt5 application mockingsample_image_path- Image file fixturesmock_email_server- Email server mockingenv_vars- Environment variable managementCommands Available
poetry run test- Run all testspoetry run tests- Alternative command (both work)Testing the Setup
Install dependencies:
Run validation tests:
poetry run test tests/test_setup_validation.pyRun all tests with coverage:
poetry run testNotes
poetry.lockfile should be committed to ensure reproducible buildsNext Steps
tests/unitandtests/integrationdirectoriesconftest.pyfor common testing needs@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slow