feat: Set up complete Python testing infrastructure with Poetry - #35
Open
llbbl wants to merge 1 commit into
Open
feat: Set up complete Python testing infrastructure with Poetry#35llbbl wants to merge 1 commit into
llbbl wants to merge 1 commit into
Conversation
- Add Poetry package manager configuration in pyproject.toml - Configure pytest with coverage reporting, custom markers, and test discovery - Create comprehensive testing directory structure (tests/, unit/, integration/) - Add shared pytest fixtures in conftest.py for robot components - Set up coverage thresholds (80%) with HTML and XML reporting - Update .gitignore with testing and IDE-related entries - Create validation tests to verify infrastructure functionality - Install testing dependencies: pytest, pytest-cov, pytest-mock
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 Blacky quadruped robot project using Poetry as the package manager and pytest as the testing framework.
Changes Made
Package Management
pyproject.tomlwith Poetry setup for dependency managementpytest(v7.4.0+) - Main testing frameworkpytest-cov(v4.1.0+) - Coverage reportingpytest-mock(v3.11.0+) - Mocking utilitiesTesting Configuration
pyproject.tomlincluding:test_*.py,*_test.py)unit,integration,slowDirectory Structure
Shared Testing Utilities
mock_hardware_interface,mock_imu,mock_joystick)mock_config,mock_state)temp_dir,numpy_arrays_equal)sample_joint_angles,sample_foot_positions)Validation & Quality Assurance
Project Maintenance
.pytest_cache/,.coverage,htmlcov/).claude/)How to Use
Running Tests
Installing Dependencies
Test Development
tests/unit/tests/integration/conftest.pyfor consistent test setuptest_*.pyor*_test.pyValidation Results
✅ All infrastructure validation tests pass (16/16)
✅ Dependencies successfully installed
✅ Coverage reporting functional (HTML and XML output)
✅ Custom markers working correctly
✅ Mock fixtures operational
Notes
UDPCommsfrom dependencies as it's not available in PyPI. This will need to be addressed separately if it's a required custom package.poetry run pytestdirectly.Next Steps
UDPCommsdependency if neededTesting Infrastructure Ready ✅
The project now has a complete, production-ready testing infrastructure. Developers can immediately start writing tests using the provided fixtures and utilities.