Skip to content

Commit

Permalink
Fix passing of kwargs to websocket_connect (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Apr 4, 2024
1 parent db85cca commit 2211d1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pytest_jupyter/jupyter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import importlib
import inspect
import io
import logging
import os
Expand Down Expand Up @@ -328,6 +329,10 @@ def client_fetch(*parts, headers=None, params=None, **kwargs):
headers.setdefault(key, value)
# Make request.
req = tornado.httpclient.HTTPRequest(url, headers=headers, connect_timeout=120)
allowed = list(inspect.signature(tornado.websocket.websocket_connect).parameters)
for name in list(kwargs):
if name not in allowed:
del kwargs[name]
return tornado.websocket.websocket_connect(req, **kwargs)

return client_fetch
Expand Down

0 comments on commit 2211d1c

Please sign in to comment.