feat: Set up comprehensive Python testing infrastructure #9
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 complete testing infrastructure for the ShiroScan project, providing a modern foundation for test-driven development using Poetry, pytest, and comprehensive tooling.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration, replacing basicrequirements.txtpoetry.lockfile for reproducible buildsTesting Framework
unit,integration, andslowmarkers for test categorizationProject Structure
Testing Configuration
moulepackagehtmlcov/), and XMLtest_*.pyfilesShared Fixtures (conftest.py)
temp_dir: Temporary directory managementtemp_file: Temporary file creationmock_requests: Mocked HTTP requestsmock_config: Configuration for testingmock_shiro_response: Shiro-specific response mockingmock_key_list: Test encryption keysmock_plugin: Plugin system mockingmock_subprocess_run: Command execution mockingmock_threading: Thread pool mockingcapture_stdout: Output capturingmock_dns_log: DNS logging mockingDevelopment Workflow
.gitignorewith comprehensive exclusions for Python developmentpoetry run test- Run all testspoetry run tests- Alternative command (both work)Instructions for Running Tests
Initial Setup
Running Tests
Writing New Tests
tests/unit/ortests/integration/conftest.pyfor common test needs@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slowtest_*.pyfor files,test_*for functionsNotes
Next Steps
With this infrastructure in place, developers can now:
slowmarkerThe testing foundation is ready for immediate use, with all necessary tooling and configuration in place.