File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ def _get_options(*args, **kwargs):
48
48
else :
49
49
dsn = None
50
50
51
+ if len (args ) > 1 :
52
+ raise TypeError ("Only single positional argument is expected" )
53
+
51
54
rv = dict (DEFAULT_OPTIONS )
52
55
options = dict (* args , ** kwargs )
53
56
if dsn is not None and options .get ("dsn" ) is None :
Original file line number Diff line number Diff line change @@ -887,3 +887,9 @@ def test_max_breadcrumbs_option(
887
887
capture_message ("dogs are great" )
888
888
889
889
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 )
You can’t perform that action at this time.
0 commit comments