feat: Add comprehensive Python testing infrastructure with Poetry#206
Open
llbbl wants to merge 1 commit into
Open
feat: Add comprehensive Python testing infrastructure with Poetry#206llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Set up Poetry package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with custom markers and coverage settings - Create tests directory structure with unit/integration subdirs - Add comprehensive pytest fixtures in conftest.py - Include validation tests to verify setup - Update .gitignore with Python and testing patterns
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 Palworld save tools project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationpoetry run testandpoetry run testscommands for running testsTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilesunit,integration,slowCoverage Settings:
htmlcov/directoryDirectory Structure
Testing Fixtures (conftest.py)
temp_dir: Creates temporary directories for test isolationtemp_file: Creates temporary files with custom contentmock_json_file: Creates mock JSON files for testingmock_save_file: Creates mock .sav files for testingmock_config: Provides mock configuration dictionariesmock_subprocess: Mocks subprocess callsmock_os_environ: Provides clean environment variablessample_player_data: Sample player data for testingsample_level_data: Sample level/world data for testingcleanup_test_files: Automatic cleanup of test filesAdditional Setup
.gitignorewith Python, testing, and IDE patternsHow to Use
Install dependencies:
Run tests:
Run specific test markers:
View coverage report:
Notes