We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76dddb9 commit eb5244aCopy full SHA for eb5244a
tests/test_wrapper.py
@@ -962,3 +962,11 @@ def lambda_handler(event, context):
962
mock_submit.assert_called_once()
963
call_args = mock_submit.call_args[0]
964
assert call_args[0] is None
965
+
966
967
+@patch("datadog_lambda.config.Config.profiling_enabled", True)
968
+def test_profiling_import_errors_caught(monkeypatch):
969
+ # when importing profiler fails, disable profiling instead of crashing app
970
+ monkeypatch.setitem(sys.modules, "ddtrace.profiling", None) # force ModuleNotFoundError
971
+ importlib.reload(wrapper)
972
+ assert not hasattr(wrapper.datadog_lambda_wrapper, "prof")
0 commit comments