feat: Set up comprehensive Python testing infrastructure with Poetry#20
Open
llbbl wants to merge 1 commit into
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#20llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Add Poetry for dependency management with pyproject.toml configuration - Configure pytest with coverage reporting (80% threshold) - Set up testing directory structure (tests/unit, tests/integration) - Add comprehensive pytest fixtures in conftest.py - Configure test discovery patterns and custom markers - Create validation tests to verify infrastructure works - Update .gitignore with testing and Python-specific entries - Add poetry script commands for running tests
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 Python Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the FilmAgent Python project using Poetry for dependency management and pytest for testing.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationpython-Levenshtein,openai,requests,tqdm,fastapi,uvicorn,torch,soundfilepytest,pytest-cov,pytest-mockTesting Configuration
test_*.pyand*_test.pyfilesunit,integration,slowFilmAgentandTTSProject Structure
Testing Fixtures
Created comprehensive fixtures in
conftest.py:temp_dir: Temporary directory managementmock_config: Mock configuration for testingsample_character_profiles: Test data for character profilessample_scene: Test scene structuremock_file_system: Mock file system setupmock_llm_response: Mock LLM API responsesmock_openai_client: Mock OpenAI clientAdditional Setup
.gitignore: Comprehensive Python gitignore including:__pycache__,*.pyc, etc.).coverage,htmlcov/, etc.).vscode/,.idea/).claude/*)__init__.pyfiles: Added to makeFilmAgentandTTSproper Python packagesHow to Use
Install dependencies:
Run tests:
Run tests with options:
View coverage report:
htmlcov/index.htmlin browsercoverage.xmlfor CI integrationNotes
poetry run testandpoetry run testscommands are available as requested