Skip to content

Commit

Permalink
pytest_plugin: fix mutable kwarg defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Sep 8, 2021
1 parent 7c41332 commit a88e36f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jupyter_server/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ async def my_test(jp_fetch):
...
"""

def client_fetch(*parts, headers={}, params={}, **kwargs):
def client_fetch(*parts, headers=None, params=None, **kwargs):
if not headers:
headers = {}
if not params:
params = {}
# Handle URL strings
path_url = url_escape(url_path_join(*parts), plus=False)
base_path_url = url_path_join(jp_base_url, path_url)
Expand Down Expand Up @@ -358,7 +362,11 @@ async def my_test(jp_fetch, jp_ws_fetch):
...
"""

def client_fetch(*parts, headers={}, params={}, **kwargs):
def client_fetch(*parts, headers=None, params=None, **kwargs):
if not headers:
headers = {}
if not params:
params = {}
# Handle URL strings
path_url = url_escape(url_path_join(*parts), plus=False)
base_path_url = url_path_join(jp_base_url, path_url)
Expand Down

0 comments on commit a88e36f

Please sign in to comment.