Skip to content

Commit bd3b2bb

Browse files
committed
add tests fix bugs
1 parent 8afeaee commit bd3b2bb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

sentry_sdk/consts.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ class OP:
489489
# This type exists to trick mypy and PyCharm into thinking `init` and `Client`
490490
# take these arguments (even though they take opaque **kwargs)
491491
class ClientConstructor:
492+
492493
def __init__(
493494
self,
494495
dsn=None, # type: Optional[str]
@@ -506,7 +507,7 @@ def __init__(
506507
transport=None, # type: Optional[Union[sentry_sdk.transport.Transport, Type[sentry_sdk.transport.Transport], Callable[[Event], None]]]
507508
transport_queue_size=DEFAULT_QUEUE_SIZE, # type: int
508509
sample_rate=1.0, # type: float
509-
send_default_pii=False, # type: bool
510+
send_default_pii=None, # type: Optional[bool]
510511
http_proxy=None, # type: Optional[str]
511512
https_proxy=None, # type: Optional[str]
512513
ignore_errors=[], # type: Sequence[Union[type, str]] # noqa: B006

tests/test_scope.py

+18
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,24 @@ def test_should_send_default_pii_false(sentry_init):
811811
assert should_send_default_pii() is False
812812

813813

814+
def test_should_send_default_pii_default_fals(sentry_init):
815+
sentry_init()
816+
817+
assert should_send_default_pii() is False
818+
819+
820+
def test_should_send_default_pii_false_with_dsn_and_spotlight(sentry_init):
821+
sentry_init(dsn="http://key@localhost/1", spotlight=True)
822+
823+
assert should_send_default_pii() is False
824+
825+
826+
def test_should_send_default_pii_true_without_dsn_and_spotlight(sentry_init):
827+
sentry_init(spotlight=True)
828+
829+
assert should_send_default_pii() is True
830+
831+
814832
def test_set_tags():
815833
scope = Scope()
816834
scope.set_tags({"tag1": "value1", "tag2": "value2"})

0 commit comments

Comments
 (0)