-
Notifications
You must be signed in to change notification settings - Fork 45
Switch inferred spans tests to pytest parametrized. #455
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
Conversation
0629cc0
to
0e76664
Compare
return result_func | ||
|
||
|
||
create_inferred_span = wrapped_span_creator(create_inferred_span) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests still pass if I remove this stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm yeah then definitely remove
assert actual.parent_id == parent.span_id | ||
assert finish_time == expect.start | ||
else: | ||
assert mock_span_finish.call_count == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the else is just to crash right? since the counts will always be 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Maybe I should change this, but I overloaded parent_name
. If set, then we essentially assume there's two inferred spans. If not set, then there's only one inferred span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a comment for clarification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What does this PR do?
Uses
pytest.mark.parametrize
to create a single parameterized test for creating inferred spans.Motivation
Cleaner. Easier to read. <3 pytest
Testing Guidelines
Additional Notes
Types of Changes
Check all that apply
https://datadoghq.atlassian.net/browse/SVLS-4291