Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/firebird/driver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#
# See LICENSE.TXT for details.

import inspect
from io import BytesIO
import pytest
from packaging.specifiers import SpecifierSet
Expand Down Expand Up @@ -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
{
Expand Down