@@ -138,7 +138,7 @@ def callback(scope):
138138 assert not calls
139139
140140
141- def test_transport_works (sentry_init , httpserver , request , capsys ):
141+ def test_transport_works (httpserver , request , capsys ):
142142 httpserver .serve_content ("ok" , 200 )
143143
144144 client = Client ("http://foobar@{}/123" .format (httpserver .url [len ("http://" ) :]))
@@ -152,3 +152,21 @@ def test_transport_works(sentry_init, httpserver, request, capsys):
152152 out , err = capsys .readouterr ()
153153 assert not err and not out
154154 assert httpserver .requests
155+
156+
157+ @pytest .mark .tests_internal_exceptions
158+ def test_client_debug_option_enabled (sentry_init , caplog ):
159+ sentry_init (debug = True )
160+
161+ Hub .current .capture_internal_exception ((ValueError , ValueError ("OK" ), None ))
162+ assert "OK" in caplog .text
163+
164+
165+ @pytest .mark .tests_internal_exceptions
166+ @pytest .mark .parametrize ("with_client" , (True , False ))
167+ def test_client_debug_option_disabled (with_client , sentry_init , caplog ):
168+ if with_client :
169+ sentry_init ()
170+
171+ Hub .current .capture_internal_exception ((ValueError , ValueError ("OK" ), None ))
172+ assert "OK" not in caplog .text
0 commit comments