Redis fixtures and fixture factories for Pytest.
Overall
score
95%
Create a custom Redis test fixture with specific data persistence settings for testing a data-critical application that requires periodic snapshots.
Build a custom Redis fixture that configures data persistence with the following settings:
Save Configuration: Configure Redis to save snapshots with these rules:
RDB Settings: Enable both RDB compression and checksum validation for data integrity
Custom Data Directory: Use a custom temporary data directory named redis_persist_data within the system temp folder
Port Configuration: Configure the Redis instance to run on port 6380
Test Integration: Create a fixture that provides a Redis client connected to this configured instance
Create two files:
conftest.py - Contains the custom fixture definitionstest_persistence.py - Contains tests demonstrating the fixture works correctlyYour implementation should pass these test cases:
@generates
# Custom Redis process fixture with persistence configuration
# Returns a Redis process executor running on port 6380
def redis_persist_proc():
pass
# Custom Redis client fixture connected to redis_persist_proc
# Returns a redis.Redis client instance
def redis_persist_client():
passProvides Redis fixtures and fixture factories for pytest with persistence configuration support.
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