This repository was archived by the owner on Sep 17, 2025. It is now read-only.
Add BaseSpan interface to make Span and BlankSpan compatible#313
Merged
mayurkale22 merged 4 commits intocensus-instrumentation:masterfrom Sep 19, 2018
Merged
Conversation
Member
Author
|
/cc @tgermain FYI |
tgermain
reviewed
Sep 18, 2018
| span = BaseSpan() | ||
|
|
||
| with self.assertRaises(NotImplementedError): | ||
| list(iter(span)) |
There was a problem hiding this comment.
a test for __enter__ and __exit__ might be missing. Something like that for instance :
from unittest import mock
@mock.patch(BaseSpan, "__enter__")
@mock.patch(BaseSpan, "__exit__")
def test_context_manager(self, m_exit, m_enter)
span = BaseSpan()
with span:
pass
self.assertTrue(m_enter.called)
self.assertTrue(m_exit.called)
Contributor
liyanhui1228
left a comment
There was a problem hiding this comment.
LGTM with minor comments.
| from opencensus.trace import time_event as time_event_module | ||
| from opencensus.trace.span_context import generate_span_id | ||
| from opencensus.trace.tracers import base | ||
| from opencensus.trace.base_span import BaseSpan |
Contributor
There was a problem hiding this comment.
Sort the imports, and import module instead of class.
Member
Author
|
Fixes #312 |
liyanhui1228
approved these changes
Sep 19, 2018
|
@liyanhui1228 Hi, can a release be cut that included this? It would really help me. Thanks! |
Member
Author
|
@davewalkexpel Unfortunately no. But we might do a patch release soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #312