feat: Add Python testing infrastructure with Poetry and pytest#352
Open
llbbl wants to merge 1 commit intocguZZman:matrixfrom
Open
feat: Add Python testing infrastructure with Poetry and pytest#352llbbl wants to merge 1 commit intocguZZman:matrixfrom
llbbl wants to merge 1 commit intocguZZman:matrixfrom
Conversation
- Set up Poetry as package manager with pyproject.toml configuration - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting and custom markers - Create test directory structure with unit/integration subdirs - Add comprehensive conftest.py with Kodi-specific fixtures - Update .gitignore with testing and Poetry entries - Add validation tests to verify infrastructure setup - Configure test commands accessible via `poetry run test[s]`
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 complete Python testing infrastructure for the Google Drive Kodi plugin using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the primary package managerpytest(^8.0.0) - Main testing frameworkpytest-cov(^5.0.0) - Coverage reportingpytest-mock(^3.14.0) - Mocking utilitiesTesting Configuration
pytest Configuration: Set up comprehensive pytest settings in
pyproject.toml:test_*.pyand*_test.pyfilesunit,integration,slow)Coverage Configuration:
resources/Directory Structure
Test Fixtures
Created comprehensive fixtures in
conftest.pyfor Kodi plugin development:temp_dir- Temporary directory managementmock_addon- Mock Kodi addon objectmock_xbmc,mock_xbmcgui,mock_xbmcplugin- Mock Kodi modulesmock_kodi_modules- Combined fixture that injects all mocks into sys.modulessample_drive_item,sample_folder_item- Sample Google Drive datamock_settings- Common plugin settingsmock_http_response- Mock HTTP responses for API testingcapture_logs- Log capture for testingAdditional Setup
Updated .gitignore: Added entries for:
.pytest_cache/,.coverage,htmlcov/, etc.)poetry.locktracked).claude/*)Validation Tests: Created
test_infrastructure.pyto verify:How to Use
Running Tests
You can run tests using either of these commands:
poetry run test poetry run testsBoth commands will:
tests/directorypyproject.tomlRunning Specific Test Categories
Installing Dependencies
Notes
Next Steps
With this infrastructure in place, developers can now:
tests/unit/directorytests/integration/directory