feat: Set up comprehensive Python testing infrastructure with Poetry#21
Open
llbbl wants to merge 1 commit intohrithikkoduri:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#21llbbl wants to merge 1 commit intohrithikkoduri:mainfrom
llbbl wants to merge 1 commit intohrithikkoduri:mainfrom
Conversation
- Add pytest, pytest-cov, and pytest-mock as test dependencies - Configure pytest with custom markers (unit, integration, slow) - Set up coverage reporting with HTML and XML output formats - Create proper test directory structure with unit/integration separation - Add comprehensive shared fixtures in conftest.py for common testing needs - Update .gitignore with testing and Claude-related entries - Create validation tests to verify the testing setup works correctly - Configure Poetry environment to support both Python 3.11 and 3.12
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 WebRover Python backend project using Poetry as the package manager. The setup provides a solid foundation for writing and running tests with proper tooling and configuration.
Changes Made
1. Testing Dependencies
Added the following testing dependencies to the Poetry configuration:
2. Testing Configuration
Configured pytest and coverage settings in
pyproject.toml:unit,integration,slow3. Directory Structure
Created a well-organized testing directory structure:
4. Shared Fixtures
Created comprehensive fixtures in
conftest.py:temp_dir- Temporary directory for test filesmock_env- Mock environment variablesmock_config- Mock configuration dictionarymock_browser,mock_page- Playwright-related mocksmock_llm- LLM instance mocksample_html_content,sample_research_data- Test data fixturescapture_logs- Log capturing fixture5. Validation Tests
Created
test_setup_validation.pyto verify:6. Additional Updates
.gitignorewith testing artifacts and Claude settingsHow to Use
Running Tests
Writing Tests
tests/unit/directorytests/integration/directory@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slowCoverage Reports
After running tests with coverage:
htmlcov/index.htmlcoverage.xmlNotes
blislibrary on ARM architectureNext Steps