-
Notifications
You must be signed in to change notification settings - Fork 45
Prevent error when attempting to use None context. #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -934,6 +934,9 @@ def setUp(self): | |
self.mock_activate = patcher.start() | ||
self.mock_activate.return_value = True | ||
self.addCleanup(patcher.stop) | ||
patcher = patch("datadog_lambda.tracing.dd_trace_context", None) | ||
self.mock_dd_trace_context = patcher.start() | ||
self.addCleanup(patcher.stop) | ||
|
||
def tearDown(self): | ||
global dd_tracing_enabled | ||
|
@@ -991,6 +994,10 @@ def test_set_dd_trace_py_root_no_span_id(self): | |
self.mock_activate.assert_called() | ||
self.mock_activate.assert_has_calls([call(expected_context)]) | ||
|
||
def test_set_dd_trace_py_root_none_context(self): | ||
set_dd_trace_py_root(TraceContextSource.EVENT, True) | ||
self.mock_activate.assert_not_called() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this seems a to be a bit spookily-long-distance There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I don't understand. The most important thing about this test is that it just doesn't raise an exception, which is what would happen before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, i see! could we add a check that confirms that it is in fact none? or something? |
||
|
||
|
||
class TestServiceMapping(unittest.TestCase): | ||
def setUp(self): | ||
|
Uh oh!
There was an error while loading. Please reload this page.