From d032edded5568b1e0ab97c8c3cc712e75207b0dd Mon Sep 17 00:00:00 2001 From: "F.D.Castel" Date: Thu, 21 May 2026 14:18:03 -0300 Subject: [PATCH] Make ServerTraceServices.start() plugins argument optional #68 added a `plugins` keyword-only parameter to ServerTraceServices.start() but without a default value, making it required. This breaks every existing caller -- including this project's own tests/test_server.py::test_trace -- with: TypeError: ServerTraceServices.start() missing 1 required keyword-only argument: 'plugins' The method body already treats the argument as optional (`if plugins is not None:`) and its docstring documents it as FB6+ only, so restore the `= None` default. Adds a regression test asserting the parameter keeps a default of None. --- src/firebird/driver/core.py | 2 +- tests/test_server.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/firebird/driver/core.py b/src/firebird/driver/core.py index ab143f7..457c24b 100644 --- a/src/firebird/driver/core.py +++ b/src/firebird/driver/core.py @@ -5496,7 +5496,7 @@ def __action(self, action: ServerAction, label: str, session_id: int) -> str: # response should contain the error message raise DatabaseError(response) return response - def start(self, *, config: str, name: str | None=None, plugins: str | list[str] | None) -> int: + def start(self, *, config: str, name: str | None=None, plugins: str | list[str] | None=None) -> int: """Start new trace session. **(ASYNC service)** Arguments: diff --git a/tests/test_server.py b/tests/test_server.py index 93e1e7f..7a28f0b 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -22,6 +22,7 @@ # # See LICENSE.TXT for details. +import inspect from io import BytesIO import pytest from packaging.specifiers import SpecifierSet @@ -158,6 +159,19 @@ def test_get_limbo_transaction_ids(server_connection, db_file): ids = server_connection.database.get_limbo_transaction_ids(database=str(db_file)) assert isinstance(ids, type(list())) +def test_trace_start_plugins_is_optional(): + """Regression: ServerTraceServices.start() must keep `plugins` optional. + + #68 added `plugins` as a keyword-only parameter but without a default, + making it required and breaking every existing caller (including + `test_trace` below, and any FB3/4/5 user) with + "missing 1 required keyword-only argument: 'plugins'". The method body + already treats it as optional (`if plugins is not None:`) and the + docstring marks it FB6+ only, so it must default to None. + """ + sig = inspect.signature(driver.core.ServerTraceServices.start) + assert sig.parameters['plugins'].default is None + def test_trace(server_connection, db_file, fb_vars): trace_config = """database = %s {