CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pytest-redis

Redis fixtures and fixture factories for Pytest.

Overall
score

95%

Overview
Eval results
Files

task.mdevals/scenario-6/

Redis Configuration Precedence Testing

A test suite that validates configuration precedence in a Redis fixture system.

Capabilities

Configuration Hierarchy Validation

Create a test suite that verifies configuration precedence behavior. The system supports three levels: factory arguments (highest), command-line options (medium), and pytest.ini settings (lowest).

  • A custom Redis fixture configured only via pytest.ini uses port 6380 @test
  • The same fixture with a CLI option --redis-port=6381 uses port 6381 instead @test
  • The same fixture with factory argument port=6382 uses port 6382, ignoring CLI and ini settings @test

Implementation

@generates

Requirements

Create a test file with:

  1. A pytest.ini configuration file that sets redis port to 6380
  2. Three test functions that validate the precedence hierarchy
  3. Custom Redis fixtures created using factory functions that accept configuration parameters
  4. Assertions that verify the correct port is used in each scenario

All tests should pass when configuration precedence works correctly.

API

# test_config.py

def test_pytest_ini_configuration():
    """Test uses port from pytest.ini (6380)."""
    pass

def test_cli_overrides_ini():
    """Test uses port from CLI option (6381), ignoring pytest.ini."""
    pass

def test_factory_args_override_all():
    """Test uses port from factory argument (6382), ignoring CLI and ini."""
    pass

Dependencies { .dependencies }

pytest-redis { .dependency }

Provides Redis fixtures with configurable options at multiple levels including factory arguments, command-line options, and configuration files.

pytest { .dependency }

Test framework that provides the testing infrastructure and fixture system.

Install with Tessl CLI

npx tessl i tessl/pypi-pytest-redis

tile.json