Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/lazy-redis-import.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed staging integration test collection by importing `redis` lazily inside the `rest_client` fixture instead of at `tests/conftest.py` module import time.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from contextlib import contextmanager
from subprocess import Popen, TimeoutExpired
import sys
import redis
import pytest

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

app.config["TESTING"] = True
with running(["redis-server"], 3):
Expand Down
Loading