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.toml
with Poetry configurationrequirements.txt
to Poetryvllm
dependency due to system build requirementsTesting Configuration
pyproject.toml
with:test_*.py
and*_test.py
filesunit
,integration
, andslow
testsDirectory Structure
Testing Fixtures (conftest.py)
Created comprehensive shared fixtures including:
temp_dir
andtemp_file
- Temporary file system resourcesmock_config
- Mock configuration dictionarysample_json_data
andjson_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.py
with 18 tests to verify:How to Use
Installation
Running Tests
Adding New Tests
tests/unit/
ortests/integration/
conftest.py
for common test needs@pytest.mark.unit
,@pytest.mark.integration
, or@pytest.mark.slow
test_*.py
for test filesNotes
--cov-fail-under=80
line inpyproject.toml
vllm
dependency requires specific system configurations and may need to be installed separatelyNext Steps
scripts/
anddemo/