|
22 | 22 | ) |
23 | 23 | from sentry_sdk.integrations.executing import ExecutingIntegration |
24 | 24 | from sentry_sdk.transport import Transport |
25 | | -from sentry_sdk.utils import logger |
26 | 25 | from sentry_sdk.serializer import MAX_DATABAG_BREADTH |
27 | 26 | from sentry_sdk.consts import DEFAULT_MAX_BREADCRUMBS, DEFAULT_MAX_VALUE_LENGTH |
28 | 27 | from sentry_sdk._types import TYPE_CHECKING |
@@ -367,60 +366,6 @@ def e(exc): |
367 | 366 | assert mock_capture_internal_exception.call_args[0][0][0] == EventCapturedError |
368 | 367 |
|
369 | 368 |
|
370 | | -def test_with_locals_deprecation_enabled(sentry_init): |
371 | | - with mock.patch.object(logger, "warning", mock.Mock()) as fake_warning: |
372 | | - sentry_init(with_locals=True) |
373 | | - |
374 | | - client = Hub.current.client |
375 | | - assert "with_locals" not in client.options |
376 | | - assert "include_local_variables" in client.options |
377 | | - assert client.options["include_local_variables"] |
378 | | - |
379 | | - fake_warning.assert_called_once_with( |
380 | | - "Deprecated: The option 'with_locals' was renamed to 'include_local_variables'. Please use 'include_local_variables'. The option 'with_locals' will be removed in the future." |
381 | | - ) |
382 | | - |
383 | | - |
384 | | -def test_with_locals_deprecation_disabled(sentry_init): |
385 | | - with mock.patch.object(logger, "warning", mock.Mock()) as fake_warning: |
386 | | - sentry_init(with_locals=False) |
387 | | - |
388 | | - client = Hub.current.client |
389 | | - assert "with_locals" not in client.options |
390 | | - assert "include_local_variables" in client.options |
391 | | - assert not client.options["include_local_variables"] |
392 | | - |
393 | | - fake_warning.assert_called_once_with( |
394 | | - "Deprecated: The option 'with_locals' was renamed to 'include_local_variables'. Please use 'include_local_variables'. The option 'with_locals' will be removed in the future." |
395 | | - ) |
396 | | - |
397 | | - |
398 | | -def test_include_local_variables_deprecation(sentry_init): |
399 | | - with mock.patch.object(logger, "warning", mock.Mock()) as fake_warning: |
400 | | - sentry_init(include_local_variables=False) |
401 | | - |
402 | | - client = Hub.current.client |
403 | | - assert "with_locals" not in client.options |
404 | | - assert "include_local_variables" in client.options |
405 | | - assert not client.options["include_local_variables"] |
406 | | - |
407 | | - fake_warning.assert_not_called() |
408 | | - |
409 | | - |
410 | | -def test_request_bodies_deprecation(sentry_init): |
411 | | - with mock.patch.object(logger, "warning", mock.Mock()) as fake_warning: |
412 | | - sentry_init(request_bodies="small") |
413 | | - |
414 | | - client = Hub.current.client |
415 | | - assert "request_bodies" not in client.options |
416 | | - assert "max_request_body_size" in client.options |
417 | | - assert client.options["max_request_body_size"] == "small" |
418 | | - |
419 | | - fake_warning.assert_called_once_with( |
420 | | - "Deprecated: The option 'request_bodies' was renamed to 'max_request_body_size'. Please use 'max_request_body_size'. The option 'request_bodies' will be removed in the future." |
421 | | - ) |
422 | | - |
423 | | - |
424 | 369 | def test_include_local_variables_enabled(sentry_init, capture_events): |
425 | 370 | sentry_init(include_local_variables=True) |
426 | 371 | events = capture_events() |
|
0 commit comments