Skip to content

Commit

Permalink
Make test_options paramter type None over Dict
Browse files Browse the repository at this point in the history
Has the potential in the future to be a bug. {} are mutable
in the scope of kwargs of a function.
  • Loading branch information
mattseymour committed Dec 13, 2022
1 parent b416fa4 commit 3c1a39b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dj_database_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down

0 comments on commit 3c1a39b

Please sign in to comment.