-
Notifications
You must be signed in to change notification settings - Fork 98
feat: set up comprehensive Python testing infrastructure with Poetry #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Conversation
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
- Add Poetry as package manager with pyproject.toml configuration - Configure pytest with coverage reporting and custom markers - Create testing directory structure (tests/unit, tests/integration) - Add comprehensive conftest.py with reusable fixtures - Set up Poetry script commands for running tests - Update .gitignore with testing and Claude settings - Add validation tests to verify infrastructure setup
@microsoft-github-policy-service agree
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 Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the P3 (Programming Puzzles and Code Competitions) project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.toml
with Poetry configurationTesting Configuration
pytest Configuration:
test_*.py
and*_test.py
filesCoverage Configuration:
generators
andsolvers
Directory Structure
Shared Fixtures (conftest.py)
temp_dir
: Temporary directory for test filestemp_file
: Temporary file with test contentmock_config
: Mock configuration dictionarysample_puzzle_data
: Sample puzzle data for testingsample_code_snippet
: Sample code for testingmock_environment_variables
: Mock environment variablesproject_root
,generators_path
,solvers_path
: Path fixturesclean_imports
: Import cleanup for test isolationreset_random_seed
: Reproducible random seedsPoetry Commands
poetry run test
- Run all testspoetry run tests
- Alternative command (both work)Additional Configuration
.gitignore
with:.pytest_cache/
,coverage.xml
,htmlcov/
).claude/*
)poetry.lock
is NOT ignored (should be in version control)Testing the Infrastructure
Installation
Running Tests
Validation Tests
The PR includes comprehensive validation tests that verify:
Notes
orderedset Dependency: The
orderedset
package from the original requirements had build issues on the current platform. It has been commented out in favor of using Python's built-inOrderedDict
when needed.Coverage Thresholds: The 80% coverage threshold has been temporarily disabled in the configuration since this PR only sets up the infrastructure without implementing actual tests for the codebase.
Deprecation Warnings: Some existing code has deprecation warnings (invalid escape sequences). These are from the existing codebase and should be addressed in a separate PR.
Next Steps
With this testing infrastructure in place, developers can now:
The infrastructure is designed to be extensible and can be enhanced with additional fixtures, plugins, and configurations as needed.