From 3c1a39b4378aeacff24ae5bb5f7e91d9f3af9849 Mon Sep 17 00:00:00 2001 From: Matt Seymour Date: Tue, 13 Dec 2022 09:00:55 +0000 Subject: [PATCH] Make test_options paramter type None over Dict Has the potential in the future to be a bug. {} are mutable in the scope of kwargs of a function. --- dj_database_url.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dj_database_url.py b/dj_database_url.py index d2a9f01..9ea982a 100644 --- a/dj_database_url.py +++ b/dj_database_url.py @@ -71,10 +71,9 @@ def parse( conn_max_age=0, conn_health_checks=False, ssl_require=False, - test_options={}, + test_options=None, ): """Parses a database URL.""" - if url == "sqlite://:memory:": # this is a special case, because if we pass this URL into # urlparse, urlparse will choke trying to interpret "memory" @@ -85,6 +84,9 @@ def parse( # otherwise parse the url as normal parsed_config = {} + if test_options is None: + test_options = {} + url = urlparse.urlsplit(url) # Split query strings from path.