feat: Set up comprehensive Python testing infrastructure with Poetry #29
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 Python 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 proper configuration, fixtures, and coverage reporting.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationrequirements.txtto Poetryvllmdependency due to system build requirementsTesting Configuration
pyproject.tomlwith:test_*.pyand*_test.pyfilesunit,integration, andslowtestsDirectory Structure
Testing Fixtures (conftest.py)
Created comprehensive shared fixtures including:
temp_dirandtemp_file- Temporary file system resourcesmock_config- Mock configuration dictionarysample_json_dataandjson_file- JSON test datamock_api_client- Mock API client with common HTTP methodsmock_llm_response- Mock LLM response structuremock_search_results- Mock search resultsenv_vars- Environment variable managementmock_file_system- Mock directory structurecapture_logs- Log capture for testingbenchmark_timer- Simple performance timingProject Configuration
.gitignore: Created comprehensive gitignore with Python, testing, and IDE-related entriesCLAUDE.md: Updated with testing commands and project structure documentationValidation
test_infrastructure_validation.pywith 18 tests to verify:How to Use
Installation
Running Tests
Adding New Tests
tests/unit/ortests/integration/conftest.pyfor common test needs@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slowtest_*.pyfor test filesNotes
--cov-fail-under=80line inpyproject.tomlvllmdependency requires specific system configurations and may need to be installed separatelyNext Steps
scripts/anddemo/