MCPcopy
hub / github.com/redis/redis-py / _clear_redis_modules

Function _clear_redis_modules

benchmarks/otel_benchmark.py:839–843  ·  view source on GitHub ↗

Remove all redis.* modules from sys.modules to allow fresh import.

()

Source from the content-addressed store, hash-verified

837
838
839def _clear_redis_modules() -> None:
840 """Remove all redis.* modules from sys.modules to allow fresh import."""
841 to_remove = [key for key in sys.modules if key == "redis" or key.startswith("redis.")]
842 for key in to_remove:
843 del sys.modules[key]
844
845
846def run_baseline_scenario(tag: str, config: LoadGeneratorConfig) -> Optional[BenchmarkResult]:

Callers 2

run_baseline_scenarioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected