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-7/

Multi-Environment Redis Testing Configuration

Build a pytest test configuration system that manages multiple isolated Redis instances with different configurations for testing a cache manager module.

Background

You are testing a cache manager that needs to work with different Redis configurations for different environments. Each environment should run on its own Redis instance to ensure complete test isolation.

Requirements

Create custom fixture configurations for two independent Redis test environments:

Development Environment

  • Should run on port 6380
  • Should use database number 0
  • Must enable automatic data cleanup between tests

Production Environment

  • Should run on a port in the range 7000-7100
  • Should use database number 1
  • Must enable automatic data cleanup between tests

Test Implementation

Write tests in test/cache_manager.test.py that verify:

  • The development Redis instance can store and retrieve a key-value pair: setting key "dev_key" to value "dev_value" and retrieving it returns "dev_value" @test
  • The production Redis instance can store and retrieve a key-value pair: setting key "prod_key" to value "prod_value" and retrieving it returns "prod_value" @test
  • Both Redis instances can be used simultaneously in the same test without interference: setting "shared_key" to "dev_data" in development and "prod_data" in production, then retrieving from each returns the correct respective values @test

Test Configuration

Configure fixtures in conftest.py to be available to all tests.

Dependencies { .dependencies }

pytest-redis { .dependency }

Provides Redis fixtures and fixture factories for Pytest.

@generates