feat: Set up comprehensive Python testing infrastructure with Poetry#355
Open
llbbl wants to merge 1 commit intoSublimeText:developmentfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#355llbbl wants to merge 1 commit intoSublimeText:developmentfrom
llbbl wants to merge 1 commit intoSublimeText:developmentfrom
Conversation
- Add Poetry configuration with pytest, pytest-cov, and pytest-mock - Configure pytest with coverage reporting (80% threshold) - Create test directory structure with unit/integration separation - Add comprehensive pytest fixtures for Sublime Text mocking - Update .gitignore with testing and build artifacts - Include validation tests to verify setup functionality
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 establishes a comprehensive testing infrastructure for the ANSI Color Build Sublime Text plugin using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.toml)pytest- Main testing frameworkpytest-cov- Coverage reportingpytest-mock- Mocking utilitiesTesting Configuration
pyproject.tomlwith:test_*.pyand*_test.pyunit,integration,slowDirectory Structure
Development Commands
Both of these commands work to run tests:
poetry run testpoetry run testsShared Fixtures (conftest.py)
Created comprehensive fixtures for testing Sublime Text plugins:
temp_dir- Temporary directory managementtemp_file- Temporary file creationmock_sublime- Mock sublime module with all constants and methodsmock_sublime_plugin- Mock sublime_plugin classes (TextCommand, WindowCommand, EventListener)mock_view- Mock Sublime Text view objectsmock_window- Mock Sublime Text window objectsmock_settings- Mock settings with get/set/has/erase functionalitysample_ansi_output- Sample ANSI colored strings for testingreset_modules- Auto-cleanup of imported modules between testscapture_stdout- Stdout capture for testing print statementsUpdated .gitignore
Added comprehensive testing-related entries:
.coverage,htmlcov/,coverage.xml).claude/*)How to Use
Install dependencies:
Run all tests:
Run specific test types:
View coverage report:
htmlcov/index.htmlin a browsercoverage.xmlfor CI integrationNotes
poetry.lock) is tracked in git for reproducible builds