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.
This commit is contained in:
Matt Seymour 2022-12-13 09:00:55 +00:00
parent b416fa416f
commit 3c1a39b437
No known key found for this signature in database

View file

@ -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.