beso
beso copied to clipboard
feat: Set up comprehensive Python testing infrastructure
Set up Python Testing Infrastructure
Summary
This PR establishes a comprehensive testing infrastructure for the BESO project, providing developers with a ready-to-use testing environment.
Changes Made
- Poetry Package Management: Set up Poetry as the package manager with
pyproject.tomlconfiguration - Testing Dependencies: Added essential testing packages:
pytest(main testing framework)pytest-cov(coverage reporting)pytest-mock(mocking utilities)
- Directory Structure: Created organized testing directories:
tests/(root test directory)tests/unit/(unit tests)tests/integration/(integration tests)- All with proper
__init__.pyfiles
- Testing Configuration: Comprehensive pytest configuration in
pyproject.toml:- Test discovery patterns
- Coverage reporting (80% threshold, HTML/XML reports)
- Custom markers (
unit,integration,slow) - Strict testing options
- Shared Fixtures: Rich
conftest.pywith common fixtures:- Temporary directories
- Mock configurations
- Sample data (observations, actions, trajectories)
- PyBullet mocking for environment testing
- Validation Tests: Comprehensive tests to verify the infrastructure works
- Updated .gitignore: Added testing-related entries and Claude Code settings
How to Run Tests
# Install dependencies
poetry install
# Run all tests
poetry run pytest
# Run with verbose output
poetry run pytest -v
# Run only unit tests
poetry run pytest -m "unit"
# Run only integration tests
poetry run pytest -m "integration"
# Run tests excluding slow ones
poetry run pytest -m "not slow"
# Generate coverage report
poetry run pytest --cov=beso --cov-report=html
Coverage Reporting
- HTML Report: Generated in
htmlcov/directory - XML Report: Generated as
coverage.xml - Terminal Report: Shows missing lines
- Threshold: Set to 80% coverage requirement
Next Steps
Developers can now:
- Write unit tests in
tests/unit/ - Write integration tests in
tests/integration/ - Use shared fixtures from
conftest.py - Run tests with coverage reporting
- Use custom markers to categorize and filter tests
The infrastructure is fully validated and ready for immediate use.
🤖 Generated with Claude Code