feat: Set up comprehensive Python testing infrastructure#97
Open
llbbl wants to merge 1 commit intoaws-samples:mainfrom
Open
feat: Set up comprehensive Python testing infrastructure#97llbbl wants to merge 1 commit intoaws-samples:mainfrom
llbbl wants to merge 1 commit intoaws-samples:mainfrom
Conversation
- Add Poetry configuration with development dependencies (pytest, pytest-cov, pytest-mock) - Create complete testing directory structure (tests/, tests/unit/, tests/integration/) - Configure pytest with custom markers (unit, integration, slow) and coverage reporting - Add comprehensive shared fixtures in conftest.py for Redis, AWS, and database mocking - Set up coverage configuration with 80% threshold and HTML/XML reporting - Include common project dependencies (boto3, redis, valkey-glide, flask, streamlit) - Update .gitignore with Claude Code settings and testing artifacts - Add validation tests to verify testing infrastructure setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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 comprehensive Python testing infrastructure
Summary
This PR establishes a complete testing infrastructure for the AWS ElastiCache examples repository, providing a unified testing environment across all Python projects in the repository.
Changes Made
Package Management & Dependencies
pyproject.tomlwith Poetry setup as the package managerpytest(main testing framework)pytest-cov(coverage reporting)pytest-mock(mocking utilities)pytest-asyncio(async testing support)boto3,redis,valkey-glide(core AWS/cache libraries)flask,streamlit(web frameworks)pandas,numpy(data processing)pydantic,python-dotenv(utilities)Testing Configuration
unit,integration,slowDirectory Structure
Shared Test Fixtures
Created comprehensive fixtures in
conftest.py:temp_dir,mock_env_vars,sample_data_dirmock_boto3_client,mock_aws_credentialsmock_redis_client,mock_valkey_clientmock_database_connection,sample_configmock_logger,sample_cache_dataCode Quality Tools
Running Tests
Install Dependencies
Run Tests
View Coverage Reports
htmlcov/index.htmlin browsercoverage.xmlfor CI/CD integrationConfiguration Details
Coverage Settings
htmlcov/), XML (coverage.xml), and terminal outputTesting Standards
test_*.pyand*_test.py@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.slowNext Steps
With this infrastructure in place, developers can now:
tests/unit/for individual componentstests/integration/for multi-component workflowsValidation
The setup includes validation tests (
test_setup_validation.py) that verify:🤖 Generated with Claude Code