or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pytest-redis@3.1.x
tile.json

tessl/pypi-pytest-redis

tessl install tessl/pypi-pytest-redis@3.1.0

Redis fixtures and fixture factories for Pytest.

Agent Success

Agent success rate when using this tile

95%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.12x

Baseline

Agent success rate without this tile

85%

task.mdevals/scenario-10/

Multi-Instance Redis Test Suite

Build a test suite that verifies the behavior of a simple distributed cache system using multiple independent Redis instances.

Requirements

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:

  1. Cache isolation: Write data to one Redis instance and verify it doesn't appear in the other instance
  2. Independent operations: Perform different operations on each instance simultaneously and verify they don't interfere with each other
  3. Connection independence: Verify that each instance can be accessed with its own connection parameters

Test Specifications

Create test file test_multi_redis.py with the following test cases:

  • Given two independent Redis fixtures (redis_one and redis_two), when a key "user:1" with value "alice" is set in redis_one, then redis_two should not contain the key "user:1" @test
  • Given two independent Redis fixtures, when redis_one stores 5 keys and redis_two stores 3 keys, then redis_one should report 5 keys (dbsize) and redis_two should report 3 keys (dbsize) @test
  • Given two independent Redis fixtures with different configurations, when both fixtures are used in the same test, then each fixture should successfully execute ping commands independently @test

Configuration

You need to create two custom Redis fixture configurations in your conftest.py:

  • redis_one: A Redis instance for primary cache operations
  • redis_two: A Redis instance for secondary cache operations

Both fixtures should be independently configurable and automatically manage their lifecycle (startup and cleanup).

Implementation

@generates

API

# 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 fixtures

Dependencies { .dependencies }

pytest-redis { .dependency }

Provides Redis fixtures and fixture factories for testing with multiple Redis instances.

@satisfied-by