This commit is contained in:
@@ -81,23 +81,8 @@ ensure_all_tables_exist()
|
||||
|
||||
def pytest_configure(config):
|
||||
"""Pytest configuration hook - runs before any tests"""
|
||||
# Ensure Redis is patched before any tests run
|
||||
try:
|
||||
import fakeredis.aioredis
|
||||
|
||||
# Create a fake Redis instance
|
||||
fake_redis = fakeredis.aioredis.FakeRedis()
|
||||
|
||||
# Patch Redis at module level
|
||||
import storage.redis
|
||||
|
||||
# Mock the global redis instance
|
||||
storage.redis.redis = fake_redis
|
||||
|
||||
print("✅ Redis patched with fakeredis in pytest_configure")
|
||||
|
||||
except ImportError:
|
||||
print("❌ fakeredis not available in pytest_configure")
|
||||
# Redis is already patched at module level, no need to do it again
|
||||
print("✅ Redis already patched at module level")
|
||||
|
||||
|
||||
def force_create_all_tables(engine):
|
||||
|
||||
Reference in New Issue
Block a user