feat: Set up comprehensive Python testing infrastructure with Poetry#11
Open
llbbl wants to merge 1 commit intodr0op:masterfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#11llbbl wants to merge 1 commit intodr0op:masterfrom
llbbl wants to merge 1 commit intodr0op:masterfrom
Conversation
- Add Poetry package manager with pyproject.toml configuration - Configure pytest with coverage reporting and custom markers - Create test directory structure with unit/integration separation - Add shared pytest fixtures in conftest.py - Configure .gitignore for test artifacts and Poetry files - Add validation tests to verify infrastructure setup - Set up Poetry scripts for running tests (poetry run test/tests)
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 WebLogic scanner Python project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the project's package managerrequestsdependency fromrequirements.txtto Poetrypytest,pytest-cov, andpytest-mockas development dependenciesTesting Configuration
pytest Configuration: Configured pytest in
pyproject.tomlwith:test_*.pyand*_test.pyfilesunit,integration, andslowCoverage Configuration: Set up coverage.py with:
appmodulehtmlcov/and XML report ascoverage.xmlProject Structure
Shared Fixtures
Created
conftest.pywith commonly needed pytest fixtures:temp_dir: Temporary directory for file operationsmock_config: Mock configuration dictionarymock_response: Mock HTTP response objectmock_requests: Mock requests moduletest_data_dir: Path to test data directorysample_url: Sample WebLogic URLsample_payload: Sample test payloadreset_environment: Auto-reset environment variablescapture_logs: Log capturing fixturemock_file_system: Mock file system structureAdditional Setup
Updated .gitignore: Added comprehensive entries for:
.pytest_cache/,.coverage,htmlcov/, etc.).claude/*)Poetry Scripts: Configured both
poetry run testandpoetry run testscommands to run pytestValidation Tests: Created
test_setup_validation.pyto verify:How to Use
Install dependencies:
Run tests:
Run specific test markers:
View coverage report:
htmlcov/index.htmlin a browsercoverage.xmlfor CI integrationNotes
pyproject.toml