diff --git a/jupyter_server/services/contents/largefilemanager.py b/jupyter_server/services/contents/largefilemanager.py index bb66b57758..938206100f 100644 --- a/jupyter_server/services/contents/largefilemanager.py +++ b/jupyter_server/services/contents/largefilemanager.py @@ -20,7 +20,7 @@ def save(self, model, path=""): path = path.strip("/") if chunk == 1: - self.run_pre_save_hook(model=model, path=path) + self.run_pre_save_hooks(model=model, path=path) if "type" not in model: raise web.HTTPError(400, "No file type provided") @@ -92,7 +92,7 @@ async def save(self, model, path=""): path = path.strip("/") if chunk == 1: - self.run_pre_save_hook(model=model, path=path) + self.run_pre_save_hooks(model=model, path=path) if "type" not in model: raise web.HTTPError(400, "No file type provided") diff --git a/pyproject.toml b/pyproject.toml index aaf768627a..be3a03d49b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -239,13 +239,7 @@ timeout = 100 timeout_method = "thread" filterwarnings = [ "error", - "ignore:Passing a schema to Validator.iter_errors:DeprecationWarning", - "ignore:run_pre_save_hook is deprecated:DeprecationWarning", - "always:unclosed = logging.ERROR: - pytest.fail(f"Logs contain an error: {message}") + with mocked_gateway: + conn = GatewayWebSocketConnection(parent=km, websocket_handler=handler) + handler.connection = conn + await conn.connect() + + # Processing websocket messages happens in separate coroutines and any + # errors in that process will show up in logs, but not bubble up to the + # caller. + # + # To check for these, we wait for the server to stop and then check the + # logs for errors. + await jp_serverapp._cleanup() + for _, level, message in caplog.record_tuples: + if level >= logging.ERROR: + pytest.fail(f"Logs contain an error: {message}") #