feat: Set up comprehensive Python testing infrastructure #63
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 dialogue-engine Python project. The setup provides developers with a ready-to-use testing environment that follows modern Python testing best practices.
Changes Made
Package Management
pyproject.tomlwith Poetry configuration as the primary package managerrequirements.txtfiles and migrated core dependenciesTesting Configuration
✅ pytest Configuration: Comprehensive pytest settings in
pyproject.tomlwith:@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slow✅ Coverage Settings: Coverage reporting configured with:
dialogue-engine/src/programyandnluDirectory Structure
Shared Test Fixtures
The
conftest.pyprovides comprehensive fixtures for:temp_dir,temp_file,mock_file_systemsample_config,sample_config_filemock_client,mock_context,mock_bot,mock_brainmock_redis,mock_mongodb,mock_sql,mock_requestssample_aiml_content,sample_aiml_fileenvironment_variables,setup_test_environmentcapture_logs,performance_timerValidation Tests
Additional Setup
Running Tests
Basic Commands
Coverage Reports
htmlcov/index.htmlin browser for detailed coveragecoverage.xmlfor CI/CD integrationInstallation
Validation Results
All infrastructure validation tests pass:
Next Steps
Developers can now:
tests/unit/following the sample patternstests/integration/using provided fixturesconftest.pypoetry run pytestin continuous integration pipelinesDependencies Added
Main Dependencies:
Development Dependencies:
Notes
pyproject.toml