feat: Set up comprehensive Python testing infrastructure with Poetry#48
Open
llbbl wants to merge 1 commit intoLTH14:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#48llbbl wants to merge 1 commit intoLTH14:mainfrom
llbbl wants to merge 1 commit intoLTH14:mainfrom
Conversation
- Migrate from setup.py to Poetry for dependency management - Add pytest, pytest-cov, and pytest-mock as dev dependencies - Configure pytest with coverage reporting (HTML/XML outputs) - Create test directory structure (unit/integration) - Add comprehensive test fixtures in conftest.py - Update .gitignore with testing and Claude-related entries - Add Poetry scripts for running tests (test/tests commands) - Include validation tests to verify infrastructure setup
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 RCG (Representation-Conditioned image Generation) project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationsetup.pyandenvironment.yamlpoetry.lockto ensure reproducible buildsTesting Framework
Testing Configuration
unit,integration, andslowmarkers for test categorizationhtmlcov/and XML incoverage.xmlDirectory Structure
Shared Fixtures (conftest.py)
temp_dir: Temporary directory for test filesmock_config: Mock configuration using OmegaConfsample_tensor: Sample PyTorch tensorssample_batch: Sample data batchesnumpy_random_state: Reproducible numpy random statetorch_random_state: Reproducible PyTorch random statemock_model_checkpoint: Mock checkpoint filesmock_image_file: Mock image files for testingdevice: Automatic CPU/GPU device selectioncleanup_cuda: Automatic CUDA cache cleanupmock_environment_variables: Temporary environment variable managementcapture_logs: Log capture for assertionsAdditional Tools
Updated Files
.gitignore: Added testing, coverage, Claude settings, and build artifact entriessetup.pyin favor of PoetryHow to Use
Installation
Running Tests
Coverage Reports
htmlcov/index.htmlin a browsercoverage.xmlfor CI/CD integrationWriting Tests
tests/unit/tests/integration/conftest.pyfor common test needs@pytest.mark.unit,@pytest.mark.slow, etc.)Notes
--cov-fail-under=80inpyproject.tomlonce tests are addedtest_setup_validation.py) verifies the infrastructure is working correctlydevgroup and won't be installed in productionNext Steps