feat: Set up comprehensive Python testing infrastructure with Poetry#100
Open
llbbl wants to merge 1 commit intoZSAIm:masterfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#100llbbl wants to merge 1 commit intoZSAIm:masterfrom
llbbl wants to merge 1 commit intoZSAIm:masterfrom
Conversation
- Configure Poetry as package manager with updated dependencies - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Create test directory structure with unit/integration subdirectories - Configure pytest and coverage settings in pyproject.toml - Add comprehensive test fixtures in conftest.py - Update .gitignore with testing and Claude-related entries - Create validation tests to verify infrastructure setup - Set up poetry run test/tests commands for easy test execution
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 Testing Infrastructure
Summary
This PR sets up a complete testing infrastructure for the VideoCrawlerEngine 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 organization, coverage reporting, and development tooling.
Changes Made
Package Management
pyproject.tomlrequirements.txtto Poetry format with updated versionsTesting Framework
Project Structure
Configuration
pytest Settings (in pyproject.toml)
unit,integration,slowCoverage Settings
coreandnbdler(GUI/handler excluded on Linux due to wxPython)Test Fixtures (conftest.py)
Comprehensive fixtures provided for common testing needs:
temp_dir: Temporary directory managementmock_config: Configuration object mockingmock_video_info: Video information mockingmock_download_info: Download progress mockingmock_cookies: Platform-specific cookie mockingmock_http_response: HTTP response mockingmock_requests: Complete requests library mockingsample_m3u8_content: M3U8 playlist testingsample_html_content: HTML parsing testingmock_file_system: File system operation mockingcapture_logs: Log capture for testingmock_threading: Threading operation mockingDevelopment Commands
Updated .gitignore
Added entries for:
.pytest_cache/,.coverage,htmlcov/,coverage.xml).claude/*)Testing the Setup
The validation test file (
test_setup_validation.py) verifies:All validation tests pass, confirming the infrastructure is properly set up.
Notes
wxPython on Linux: Due to wxPython's complex build requirements on Linux, it's marked as optional for non-Linux platforms. This allows CI/CD pipelines to run on Linux without GUI dependencies.
Coverage Threshold: Currently set to 0% to allow initial setup. This should be gradually increased as more tests are added to the codebase.
Poetry Lock File: The
poetry.lockfile is intentionally not gitignored as it ensures reproducible builds across environments.Next Steps
With this infrastructure in place, developers can now:
tests/unit/directorytests/integration/directoryThe testing infrastructure is ready for immediate use!