feat: Set up comprehensive Python testing infrastructure #11
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 behaviour cloning benchmarks project, providing developers with a robust foundation for writing and running tests.
Changes Made
Package Management
pyproject.tomlpytest ^7.4.0- Main testing frameworkpytest-cov ^4.1.0- Coverage reportingpytest-mock ^3.11.1- Enhanced mocking utilitiesTesting Configuration
@pytest.mark.unit- Unit tests@pytest.mark.integration- Integration tests@pytest.mark.slow- Long-running testsDirectory Structure
Shared Test Fixtures
Created comprehensive fixtures in
conftest.py:temp_dir,temp_filefor temporary file testingmock_configwith realistic test settingsmock_agent,mock_dataset,mock_environmentfor behavioral testingsample_observation,sample_actionfor consistent test dataclean_environment,disable_gpufor isolated testingDevelopment Tools
poetry run testandpoetry run testsworkhtmlcov/, XML reports incoverage.xml-m unit,-m integration,-m slowUpdated .gitignore
Added comprehensive exclusions for:
.pytest_cache/,.coverage,htmlcov/)venv/,.venv/, etc.)build/,dist/,*.egg-info/).vscode/, etc.).claude/*)Usage Instructions
Running Tests
Coverage Reports
--cov-report=term-missinghtmlcov/index.htmlin browser for detailed coveragecoverage.xmlWriting Tests
tests/unit/tests/integration/conftest.pyfor common test data and mocks@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowValidation
✅ All 23 validation tests pass
✅ Both
poetry run testandpoetry run testscommands work✅ Coverage reporting generates properly in all formats
✅ Test markers function correctly
✅ Shared fixtures work as expected
✅ Directory structure follows best practices
Next Steps
Developers can now:
tests/unit/tests/integration/The infrastructure is ready for immediate use - no additional setup required!