From 338d0c5b3af8c9b3e34e16be9509ac5290b85b34 Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Mon, 18 Nov 2019 15:03:31 +0000 Subject: [PATCH] Update live_server_helper.py --- pytest_django/live_server_helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytest_django/live_server_helper.py b/pytest_django/live_server_helper.py index 94ded3315..54151c28a 100644 --- a/pytest_django/live_server_helper.py +++ b/pytest_django/live_server_helper.py @@ -24,8 +24,11 @@ def __init__(self, addr): and conn.settings_dict["NAME"] == ":memory:" ): # Explicitly enable thread-shareability for this connection - conn.allow_thread_sharing = True - connections_override[conn.alias] = conn + try: + conn.allow_thread_sharing = True + connections_override[conn.alias] = conn + except AttributeError: + pass liveserver_kwargs = {"connections_override": connections_override} from django.conf import settings