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