Skip to content

Commit b38267f

Browse files
committed
[feat/1316] test cases fix
1 parent 8698762 commit b38267f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jupyter_server/prometheus/server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,11 @@ def stop(self) -> None:
234234
self.http_server.stop()
235235
self.http_server = None
236236

237+
<<<<<<< HEAD
237238
if hasattr(self, "ioloop") and self.ioloop:
239+
=======
240+
if hasattr(self, 'ioloop') and self.ioloop is not None:
241+
>>>>>>> 96530763b ([feat/1316] test cases fix)
238242
# Stop the IOLoop
239243
self.ioloop.add_callback(self.ioloop.stop)
240244
self.ioloop = None

jupyter_server/serverapp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,6 @@ def start_app(self) -> None:
31463146
# Determine metrics URL based on whether separate metrics server is running
31473147
if (
31483148
self.metrics_port
3149-
and self.metrics_server is not None
31503149
and hasattr(self.metrics_server, "port")
31513150
and self.metrics_server.port is not None
31523151
):
@@ -3243,7 +3242,7 @@ async def _cleanup(self) -> None:
32433242
self.http_server.stop()
32443243
if hasattr(self, "metrics_server"):
32453244
# Stop the metrics server if it's running
3246-
if self.metrics_server is not None and hasattr(self.metrics_server, "stop"):
3245+
if hasattr(self.metrics_server, 'stop'):
32473246
self.metrics_server.stop()
32483247

32493248
def start_ioloop(self) -> None:

jupyter_server/services/contents/handlers.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@
2525

2626

2727
def _validate_keys(expect_defined: bool, model: dict[str, Any], keys: list[str]):
28-
"""
29-
Validate that the keys are defined (i.e. not None) or not (i.e. None)
30-
"""
31-
28+
"""Validate that keys are defined or not defined as expected."""
3229
if expect_defined:
33-
errors = [key for key in keys if model[key] is None]
30+
errors = {key: model[key] for key in keys if model[key] is None}
3431
if errors:
3532
raise web.HTTPError(
3633
500,
@@ -400,7 +397,7 @@ class NotebooksRedirectHandler(JupyterHandler):
400397
"PATCH",
401398
"POST",
402399
"DELETE",
403-
) # type:ignore[assignment]
400+
)
404401

405402
@allow_unauthenticated
406403
def get(self, path):

0 commit comments

Comments
 (0)