Skip to content

Commit 4118fd3

Browse files
authored
Fix fixture name (#33)
1 parent 64d3bc9 commit 4118fd3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pytest_jupyter/jupyter_server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def jp_argv():
107107

108108

109109
@pytest.fixture()
110-
def http_port(http_server_port):
110+
def jp_http_port(http_server_port):
111111
"""Returns the port value from the http_server_port fixture."""
112112
yield http_server_port[-1]
113113
http_server_port[0].close()
@@ -161,7 +161,7 @@ def jp_configurable_serverapp(
161161
jp_environ,
162162
jp_server_config,
163163
jp_argv,
164-
http_port,
164+
jp_http_port,
165165
jp_base_url,
166166
tmp_path,
167167
jp_root_dir,
@@ -195,7 +195,7 @@ def _configurable_serverapp(
195195
base_url=jp_base_url,
196196
argv=jp_argv,
197197
environ=jp_environ,
198-
http_port=http_port,
198+
http_port=jp_http_port,
199199
tmp_path=tmp_path,
200200
io_loop=io_loop,
201201
root_dir=jp_root_dir,
@@ -222,7 +222,7 @@ def _configurable_serverapp(
222222
app = ServerApp.instance(
223223
# Set the log level to debug for testing purposes
224224
log_level="DEBUG",
225-
port=http_port,
225+
port=jp_http_port,
226226
port_retries=0,
227227
open_browser=False,
228228
base_url=base_url,
@@ -315,7 +315,7 @@ def client_fetch(*parts, headers=None, params=None, **kwargs):
315315

316316

317317
@pytest.fixture
318-
def jp_ws_fetch(jp_serverapp, http_server_client, jp_auth_header, http_port, jp_base_url):
318+
def jp_ws_fetch(jp_serverapp, http_server_client, jp_auth_header, jp_http_port, jp_base_url):
319319
"""Sends a websocket request to a test server.
320320
The fixture is a factory; it can be called like
321321
a function inside a unit test. Here's a basic
@@ -348,7 +348,7 @@ def client_fetch(*parts, headers=None, params=None, **kwargs):
348348
# Handle URL strings
349349
path_url = url_escape(url_path_join(*parts), plus=False)
350350
base_path_url = url_path_join(jp_base_url, path_url)
351-
urlparts = urllib.parse.urlparse(f"ws://localhost:{http_port}")
351+
urlparts = urllib.parse.urlparse(f"ws://localhost:{jp_http_port}")
352352
urlparts = urlparts._replace(path=base_path_url, query=urllib.parse.urlencode(params))
353353
url = urlparts.geturl()
354354
# Add auth keys to header

tests/test_jupyter_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def test_send_request(send_request):
2121
assert code == 200
2222

2323

24-
async def test_connection(jp_fetch, jp_ws_fetch, http_port, jp_auth_header):
24+
async def test_connection(jp_fetch, jp_ws_fetch, jp_http_port, jp_auth_header):
2525
# Create kernel
2626
r = await jp_fetch("api", "kernels", method="POST", body="{}")
2727
kid = json.loads(r.body.decode())["id"]

0 commit comments

Comments
 (0)