feat: Set up comprehensive Python testing infrastructure with Poetry #18
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 project using Poetry as the package manager and pytest as the testing framework. The setup provides a solid foundation for writing and running tests with coverage reporting.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationrequirements.txtto Poetrypytest,pytest-cov, andpytest-mockas development dependenciesTesting Configuration
pytest Configuration: Configured pytest in
pyproject.tomlwith:test_*.py,*_test.py, andtests.pyunit,integration, andslowCoverage Configuration: Set up coverage tracking for all main modules:
brute,domainsites,lib,reverse, andsearchenginemodules__init__.pyfiles from coverageDirectory Structure
Shared Fixtures (conftest.py)
Created comprehensive test fixtures including:
temp_dirandtemp_file: Temporary file system utilitiesmock_config: Mock configuration objectmock_requests: Mock HTTP requestsmock_dns_resolver: Mock DNS resolutionsample_domain_listandsample_ip_list: Test datamock_logger: Mock logging functionalitymock_file_system: Mock file operationsenvironment_vars: Environment variable managementmock_subprocess: Mock subprocess callscapture_output: Stdout/stderr capture utilitymock_time: Time-related mockingAdditional Updates
.gitignore: Added entries for:.pytest_cache/,.coverage,htmlcov/, etc.)__pycache__/,*.pyc, etc.).claude/*)How to Use
Installing Dependencies
Running Tests
Both of these commands work:
poetry run test poetry run testsRunning Specific Test Categories
Coverage Reports
After running tests, coverage reports are available:
htmlcov/index.htmlin a browsercoverage.xmlfor CI integrationNotes
argparsedependency was removed as it's built into Python 3poetry runprefix to use the virtual environmentNext Steps