Redis fixtures and fixture factories for Pytest.
Overall
score
95%
Build a test suite that verifies the behavior of a simple distributed cache system using multiple independent Redis instances.
Your task is to create a test configuration that sets up and uses two independent Redis database instances for testing different aspects of a distributed caching system. The tests should verify:
Create test file test_multi_redis.py with the following test cases:
You need to create two custom Redis fixture configurations in your conftest.py:
redis_one: A Redis instance for primary cache operationsredis_two: A Redis instance for secondary cache operationsBoth fixtures should be independently configurable and automatically manage their lifecycle (startup and cleanup).
@generates
# conftest.py should define:
# - redis_one: A Redis client fixture for the first instance
# - redis_two: A Redis client fixture for the second instance
# test_multi_redis.py should contain test functions that use both fixturesProvides Redis fixtures and fixture factories for testing with multiple Redis instances.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-pytest-redisdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10