Skip to content

Commit 3a1ddf8

Browse files
committed
Import redis lazily in test fixture
1 parent 3b163e3 commit 3a1ddf8

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed staging integration test collection by importing `redis` lazily inside the `rest_client` fixture instead of at `tests/conftest.py` module import time.

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from contextlib import contextmanager
44
from subprocess import Popen, TimeoutExpired
55
import sys
6-
import redis
76
import pytest
87

98
# Add the project root directory to PYTHONPATH
@@ -31,6 +30,7 @@ def running(process_arguments, seconds_to_wait_after_launch=0):
3130
def client():
3231
"""run the app for the tests to run against"""
3332
from policyengine_api.api import app
33+
import redis
3434

3535
app.config["TESTING"] = True
3636
with running(["redis-server"], 3):

0 commit comments

Comments
 (0)