feat: Set up comprehensive Python testing infrastructure with Poetry#34
Open
llbbl wants to merge 1 commit intodropreg:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#34llbbl wants to merge 1 commit intodropreg:mainfrom
llbbl wants to merge 1 commit intodropreg:mainfrom
Conversation
- Add Poetry as package manager with pyproject.toml configuration - Configure pytest with coverage reporting and custom markers - Create test directory structure with unit/integration separation - Add pytest fixtures for common testing scenarios - Configure .gitignore with testing-related entries - Add validation tests to verify infrastructure setup Test commands available: - poetry run test - poetry run 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 comprehensive testing infrastructure for the R-Drop project using Poetry as the package manager and pytest as the testing framework. The setup provides a ready-to-use environment where developers can immediately start writing tests for the codebase.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the primary package managerpytest(^7.4.3) - Core testing frameworkpytest-cov(^4.1.0) - Coverage reporting pluginpytest-mock(^3.12.0) - Mocking utilitiesTesting Configuration
pyproject.toml:test_*.pyand*_test.pyfilesDirectory Structure
Testing Fixtures
Created comprehensive fixtures in
conftest.py:temp_dir- Temporary directory managementmock_config- Mock configuration for testingsample_data- Sample data for testsmock_model_output- Mock PyTorch tensorsmock_file_system- Mock file system structurecapture_logs- Log capturing for testsdisable_gpu- Force CPU-only executionAdditional Setup
.gitignore: Updated with Python and testing-related entriesHow to Use
Installation
Running Tests
Writing Tests
tests/unit/directorytests/integration/directory@pytest.mark.unit,@pytest.mark.integration, or@pytest.mark.slowNotes
setup.pyfiles in subdirectories are preserved for compatibilityNext Steps