feat: Set up comprehensive Python testing infrastructure#11
Open
llbbl wants to merge 1 commit intoALRhub:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure#11llbbl wants to merge 1 commit intoALRhub:mainfrom
llbbl wants to merge 1 commit intoALRhub:mainfrom
Conversation
- Configure Poetry as package manager with pyproject.toml - Add pytest, pytest-cov, and pytest-mock as test dependencies - Create structured test directories (tests/unit, tests/integration) - Configure coverage reporting with 80% threshold and multiple formats - Set up shared fixtures and test utilities in conftest.py - Add custom pytest markers for unit, integration, and slow tests - Update .gitignore with testing artifacts and development files - Create validation tests to verify infrastructure functionality - Enable both 'poetry run test' and 'poetry run tests' commands
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 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!