Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing of kwargs to websocket_connect #81

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading