feat: Set up Python testing infrastructure with Poetry - #145
Open
llbbl wants to merge 1 commit into
Open
Conversation
- Add pyproject.toml with Poetry configuration and testing dependencies - Configure pytest with coverage reporting, custom markers, and strict options - Set up comprehensive testing directory structure (tests/, unit/, integration/) - Create shared fixtures in conftest.py for common testing scenarios - Add validation tests to verify infrastructure functionality - Update .gitignore with testing and development entries - Migrate existing pip dependencies to Poetry management
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.
Python Testing Infrastructure Setup
Summary
This PR establishes a complete testing infrastructure for the Odoo auto-addons Python project using Poetry as the package manager. The infrastructure provides a ready-to-use testing environment where developers can immediately start writing and running tests.
Changes Made
Package Management
pyproject.tomlwith Poetry configurationsources/pip.txtto Poetry format:erppeek==1.6.3OdooRPC==0.6.0py3o.template==0.9.11py3o.types==0.1.1Testing Dependencies Added
pytest ^7.0.0- Main testing frameworkpytest-cov ^4.0.0- Coverage reportingpytest-mock ^3.10.0- Mocking utilitiesTesting Configuration
pytest configuration in
pyproject.toml:test_*.py,*_test.py)unit,integration,slowCoverage configuration:
auto_addonsmoduleDirectory Structure
Shared Fixtures (
conftest.py)temp_dir- Temporary directory for test isolationmock_subprocess- Mock subprocess callsmock_os_path- Mock filesystem operationssample_oca_dependencies- Sample OCA dependency configurationsmock_file_operations- Mock file read/write operationsmock_git_operations- Mock git command operationsrepo_config- Repository configuration for testingodoo_paths- Odoo-related path configurationsInfrastructure Validation
Additional Updates
.gitignorewith testing-related entries:.pytest_cache/, coverage reports, virtual environmentsRunning Tests
Install Dependencies
Run Tests
Coverage Reports
htmlcov/directorycoverage.xmlfor CI/CD integrationDevelopment Workflow
tests/unit/,tests/integration/)conftest.pyfor common test scenarios@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slow)Notes
auto_addonscode contains Python 2 syntax that causes import warnings, but this doesn't affect the testing infrastructure functionalityTesting Infrastructure Validation
✅ All validation tests pass
✅ pytest and plugins properly installed
✅ Coverage reporting functional
✅ Directory structure correct
✅ Shared fixtures working
✅ Custom markers configured
✅ Poetry commands functional