feat: Set up comprehensive Python testing infrastructure with Poetry#34
Open
llbbl wants to merge 1 commit intoPromtEngineer:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#34llbbl wants to merge 1 commit intoPromtEngineer:mainfrom
llbbl wants to merge 1 commit intoPromtEngineer:mainfrom
Conversation
- Initialize Poetry package manager and migrate dependencies from requirements.txt - Add pytest, pytest-cov, and pytest-mock as development dependencies - Configure pytest with custom markers (unit, integration, slow) - Set up coverage reporting with 80% threshold and multiple output formats - Create proper test directory structure with unit/integration subdirectories - Add comprehensive shared fixtures in conftest.py for common testing patterns - Create validation tests to verify infrastructure setup - Update .gitignore with testing and Claude-specific entries - Add convenient test runner script with coverage options - Configure both 'poetry run test' and 'poetry run tests' commands Note: PyAudio dependency temporarily removed due to missing system dependencies
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.
Add Comprehensive Python Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the JARVIS Voice Assistant project using Poetry as the package manager and pytest as the testing framework. The infrastructure provides everything needed for developers to immediately start writing and running tests.
Changes Made
Package Management
pyproject.tomlwith full Poetry setuprequirements.txtandsetup.pyto PoetryTesting Configuration
pytest Configuration:
test_*.pyand*_test.pyfilesunit,integration,slowCoverage Configuration:
htmlcov/), XML (coverage.xml)Directory Structure
Shared Fixtures (conftest.py)
temp_dir: Creates temporary directories for test isolationtemp_file: Creates temporary files with contentmock_config: Provides mock configuration dictionariesmock_env_vars: Sets up mock environment variablesmock_api_response: Mock API response structuresmock_audio_data: Mock audio data for testingmock_llm_client,mock_tts_client,mock_stt_client: Mock service clientscapture_logs: Captures log messages during testsmock_file_system: Creates mock file system structuresperformance_timer: Measures test execution timeRunning Tests
Basic Commands
Using the Test Script
Validation
The infrastructure has been validated with 17 passing tests that verify:
Notes
[tool.coverage.run]source to include your application code when ready.Next Steps
Install system dependencies for PyAudio if audio functionality is needed:
Update coverage configuration to include source code:
Start writing tests in the
tests/unit/andtests/integration/directoriesConsider adding pre-commit hooks to run tests automatically
Testing the Setup
To verify everything is working correctly: