|
1 | 1 | # flake8: noqa
|
2 | 2 | # DEV: Skip linting, we lint with Python 2, we'll get SyntaxErrors from `async`
|
3 | 3 | import aiobotocore
|
4 |
| -from nose.tools import eq_ |
5 | 4 |
|
6 | 5 | from ddtrace.contrib.aiobotocore.patch import patch, unpatch
|
7 | 6 |
|
@@ -42,32 +41,32 @@ async def test_response_context_manager(self):
|
42 | 41 | pre_08 = int(version[0]) == 0 and int(version[1]) < 8
|
43 | 42 | # Version 0.8+ generates only one span for reading an object.
|
44 | 43 | if pre_08:
|
45 |
| - eq_(len(traces), 2) |
46 |
| - eq_(len(traces[0]), 1) |
47 |
| - eq_(len(traces[1]), 1) |
| 44 | + assert len(traces) == 2 |
| 45 | + assert len(traces[0]) == 1 |
| 46 | + assert len(traces[1]) == 1 |
48 | 47 |
|
49 | 48 | span = traces[0][0]
|
50 |
| - eq_(span.get_tag('aws.operation'), 'GetObject') |
51 |
| - eq_(span.get_tag('http.status_code'), '200') |
52 |
| - eq_(span.service, 'aws.s3') |
53 |
| - eq_(span.resource, 's3.getobject') |
| 49 | + assert span.get_tag('aws.operation') == 'GetObject' |
| 50 | + assert span.get_tag('http.status_code') == '200' |
| 51 | + assert span.service == 'aws.s3' |
| 52 | + assert span.resource == 's3.getobject' |
54 | 53 |
|
55 | 54 | read_span = traces[1][0]
|
56 |
| - eq_(read_span.get_tag('aws.operation'), 'GetObject') |
57 |
| - eq_(read_span.get_tag('http.status_code'), '200') |
58 |
| - eq_(read_span.service, 'aws.s3') |
59 |
| - eq_(read_span.resource, 's3.getobject') |
60 |
| - eq_(read_span.name, 's3.command.read') |
| 55 | + assert read_span.get_tag('aws.operation') == 'GetObject' |
| 56 | + assert read_span.get_tag('http.status_code') == '200' |
| 57 | + assert read_span.service == 'aws.s3' |
| 58 | + assert read_span.resource == 's3.getobject' |
| 59 | + assert read_span.name == 's3.command.read' |
61 | 60 | # enforce parenting
|
62 |
| - eq_(read_span.parent_id, span.span_id) |
63 |
| - eq_(read_span.trace_id, span.trace_id) |
| 61 | + assert read_span.parent_id == span.span_id |
| 62 | + assert read_span.trace_id == span.trace_id |
64 | 63 | else:
|
65 |
| - eq_(len(traces[0]), 1) |
66 |
| - eq_(len(traces[0]), 1) |
| 64 | + assert len(traces[0]) == 1 |
| 65 | + assert len(traces[0]) == 1 |
67 | 66 |
|
68 | 67 | span = traces[0][0]
|
69 |
| - eq_(span.get_tag('aws.operation'), 'GetObject') |
70 |
| - eq_(span.get_tag('http.status_code'), '200') |
71 |
| - eq_(span.service, 'aws.s3') |
72 |
| - eq_(span.resource, 's3.getobject') |
73 |
| - eq_(span.name, 's3.command') |
| 68 | + assert span.get_tag('aws.operation') == 'GetObject' |
| 69 | + assert span.get_tag('http.status_code') == '200' |
| 70 | + assert span.service == 'aws.s3' |
| 71 | + assert span.resource == 's3.getobject' |
| 72 | + assert span.name == 's3.command' |
0 commit comments