feat: Set up comprehensive Python testing infrastructure#11
Open
llbbl wants to merge 1 commit intotransic-robot:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure#11llbbl wants to merge 1 commit intotransic-robot:mainfrom
llbbl wants to merge 1 commit intotransic-robot:mainfrom
Conversation
- Configure Poetry as package manager with pyproject.toml - Migrate dependencies from requirements.txt and setup.py - Add pytest, pytest-cov, pytest-mock as test dependencies - Create testing configuration with 80% coverage threshold - Set up tests/ directory structure with unit/integration subdirs - Add comprehensive shared fixtures in conftest.py - Configure test markers (unit, integration, slow) - Update .gitignore with testing and coverage entries - Add validation tests to verify infrastructure setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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 TRANSIC project using Poetry and pytest. The setup provides a complete foundation for writing and running tests with proper coverage reporting and CI/CD integration capabilities.
Key Changes Made:
pyproject.tomlrequirements.txtandsetup.pyto Poetry formattests/directory withunit/andintegration/subdirectoriesconftest.pyfor common testing scenariosTesting Infrastructure Components Added
Configuration Files
pyproject.toml- Complete Poetry and pytest configuration.gitignore- Testing artifacts and coverage reports excludedDirectory Structure
Test Markers
@pytest.mark.unit- For unit tests@pytest.mark.integration- For integration tests@pytest.mark.slow- For slow-running testsShared Fixtures Available
temp_dir,temp_file- Temporary file system fixturesmock_config,sample_config_dict- Configuration mockingsample_tensor,sample_numpy_array- Data fixtures for ML testingmock_env,mock_policy- RL environment and policy mockingmock_dataset,mock_dataloader- Data loading fixturessample_pointcloud,sample_trajectory- Domain-specific test datamock_lightning_module- PyTorch Lightning testing supportRunning Tests
Basic Commands
Coverage Reports
htmlcov/directorycoverage.xmlDependencies and Compatibility
Key Dependencies Added
pytest ^7.4.0- Main testing frameworkpytest-cov ^4.1.0- Coverage reportingpytest-mock ^3.11.1- Enhanced mocking capabilitiesPython Version Compatibility
rl-gamesdependency (requires Python <3.11)Validation
All tests pass successfully:
Next Steps
Developers can now:
tests/unit/tests/integration/conftest.pypoetry run pytest🤖 Generated with Claude Code