feat: Set up comprehensive Python testing infrastructure with Poetry#29
Open
llbbl wants to merge 1 commit intoRUC-NLPIR:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#29llbbl wants to merge 1 commit intoRUC-NLPIR:mainfrom
llbbl wants to merge 1 commit intoRUC-NLPIR:mainfrom
Conversation
- Configure Poetry as package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting and custom markers - Create tests/ directory structure with unit and integration subdirs - Add comprehensive shared fixtures in conftest.py - Create .gitignore with Python and testing-related entries - Add validation tests to verify infrastructure works correctly - Update CLAUDE.md with testing commands and project structure Note: vllm dependency commented out due to system requirements
KOGTI-2023
approved these changes
Jul 28, 2025
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 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/