feat: Set up comprehensive Python testing infrastructure#3
Open
llbbl wants to merge 1 commit into
Open
Conversation
- Add Poetry package manager with pyproject.toml configuration - Create test directory structure with unit/integration subdirectories - Configure pytest with coverage, markers, and custom fixtures - Add development dependencies: pytest, pytest-cov, pytest-mock - Set up poe tasks for running tests with `poetry run poe test` - Update .gitignore with testing and Claude-specific entries - Add 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 establishes a comprehensive testing infrastructure for the Redis RCE Python project, enabling developers to immediately start writing and running tests with modern tooling.
Changes Made
Package Management
pyproject.tomlrequirements.txtargparsedependency (built-in to Python 3.8+)package-mode = falsefor script-based projectTesting Framework
Directory Structure
Configuration (pyproject.toml)
pytest settings:
unit,integration,slowcoverage settings:
htmlcov/directoryShared Fixtures (conftest.py)
temp_dir: Temporary directory for test filesmock_config: Sample configuration dictionarymock_redis_client: Mock Redis client for testingmock_socket: Mock network socketsample_redis_response: Redis protocol test datamock_args: Mock command-line argumentsreset_environment: Environment variable isolationcapture_stdout: Stdout capture utilityisolation: Complete test isolation with temp directoryDevelopment Workflow
.gitignorewith:__pycache__/,*.pyc, etc.).pytest_cache/,.coverage,htmlcov/).claude/*)How to Use
Install Dependencies
Run Tests
Coverage Reports
htmlcov/index.htmlin browsercoverage.xmlfor CI toolsNotes
redis-rce.py) needs refactoring into modules for proper testingunit/orintegration/)Next Steps
redis-rce.pyinto testable modules