feat: Set up Python testing infrastructure with Poetry and pytest #202
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 complete testing infrastructure for the XXMI Launcher project, migrating from traditional
requirements.txtto modern Poetry package management and setting up pytest as the testing framework.Changes Made
Package Management
pyproject.tomlwith Poetry configurationrequirements.txtto PoetryTesting Framework
Project Structure
Testing Configuration (pyproject.toml)
@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowShared Fixtures (conftest.py)
temp_dir- Temporary directory managementmock_config_dir- Mock configuration directorymock_app_config- Application configuration mocksmock_game_info- Game information mocksmock_mod_info- Mod information mocksmock_requests_get- Network request mockingmock_subprocess- Subprocess execution mockingmock_logger- Logger mockingmock_window- GUI window mockingclean_environment- Environment variable isolationmock_platform_system- Platform detection mockingDevelopment Commands
Updated .gitignore
Added entries for:
.pytest_cache/,.coverage,htmlcov/, etc.)dist/,*.egg-info/).claude/*)Testing the Infrastructure
The validation test suite (
test_infrastructure_validation.py) verifies:All 12 validation tests pass successfully, confirming the infrastructure is properly configured.
Next Steps
tests/unit/tests/integration/pyproject.tomlindicate where to update the coverage thresholdNotes
poetry.lock) is intentionally not gitignored and should be committed