feat: Set up complete Python testing infrastructure with Poetry - #187
Open
llbbl wants to merge 1 commit into
Open
feat: Set up complete Python testing infrastructure with Poetry#187llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Add pyproject.toml with Poetry configuration and migrated dependencies - Configure pytest with coverage reporting and custom markers - Create tests directory structure with shared fixtures in conftest.py - Add comprehensive gitignore entries for testing and development - Include validation tests to verify infrastructure works correctly
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.
Set Up Python Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the newm Wayland compositor project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationrequirements.txtandsetup.pyto Poetry__main__.py) for bothnewmandnewm_panel_basicpackagesTesting Framework
Testing Structure
Shared Fixtures (conftest.py)
Created comprehensive fixtures for common testing needs:
temp_dir: Temporary directory managementmock_config_dir,mock_cache_dir,mock_runtime_dir: XDG directory mockingsample_config_file: Sample newm configurationmock_display: Wayland display mockmock_dbus_session: D-Bus session mockmock_pam_handle: PAM authentication mockmock_cairo_surface: Cairo surface mockmock_gesture_event: Gesture event mockclean_environment: Environment variable cleanupcapture_logs: Log capturing utilityOther Changes
How to Use
Installing Dependencies
# Install all dependencies including dev dependencies poetry installRunning Tests
Coverage Reports
After running tests with coverage, reports are generated in:
htmlcov/index.htmlcoverage.xmlNotes
poetry run testandpoetry run testscommands are available but currently not working due to Poetry limitations with script aliases