Skip to content

Commit 6a805fa

Browse files
authored
ref: Update error verbose for sentry init (#1361)
1 parent 4cce4b5 commit 6a805fa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

sentry_sdk/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def _get_options(*args, **kwargs):
4848
else:
4949
dsn = None
5050

51+
if len(args) > 1:
52+
raise TypeError("Only single positional argument is expected")
53+
5154
rv = dict(DEFAULT_OPTIONS)
5255
options = dict(*args, **kwargs)
5356
if dsn is not None and options.get("dsn") is None:

tests/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,3 +887,9 @@ def test_max_breadcrumbs_option(
887887
capture_message("dogs are great")
888888

889889
assert len(events[0]["breadcrumbs"]["values"]) == expected_breadcrumbs
890+
891+
892+
def test_multiple_positional_args(sentry_init):
893+
with pytest.raises(TypeError) as exinfo:
894+
sentry_init(1, None)
895+
assert "Only single positional argument is expected" in str(exinfo.value)

0 commit comments

Comments
 (0)