Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Use assertEqual instead of assertEquals for Python 3.11 compatibility. #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions testbed/test_common_request_handler/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def test_two_callbacks(self):
lambda: len(self.tracer.finished_spans()) >= 2)
self.loop.run_forever()

self.assertEquals('message1::response', res_future1.result())
self.assertEquals('message2::response', res_future2.result())
self.assertEqual('message1::response', res_future1.result())
self.assertEqual('message2::response', res_future2.result())

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

for span in spans:
self.assertEquals(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)
self.assertEqual(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)

self.assertNotSameTrace(spans[0], spans[1])
self.assertIsNone(spans[0].parent_id)
Expand All @@ -81,12 +81,12 @@ def test_parent_not_picked(self):
async def do():
with self.tracer.start_active_span('parent'):
response = await self.client.send_task('no_parent')
self.assertEquals('no_parent::response', response)
self.assertEqual('no_parent::response', response)

self.loop.run_until_complete(do())

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

child_span = get_one_by_operation_name(spans, 'send')
self.assertIsNotNone(child_span)
Expand All @@ -107,17 +107,17 @@ async def do():
client = Client(req_handler, self.loop)
response = await client.send_task('correct_parent')

self.assertEquals('correct_parent::response', response)
self.assertEqual('correct_parent::response', response)

# Send second request, now there is no active parent,
# but it will be set, ups
response = await client.send_task('wrong_parent')
self.assertEquals('wrong_parent::response', response)
self.assertEqual('wrong_parent::response', response)

self.loop.run_until_complete(do())

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 3)
self.assertEqual(len(spans), 3)

spans = sorted(spans, key=lambda x: x.start_time)
parent_span = get_one_by_operation_name(spans, 'parent')
Expand Down
20 changes: 10 additions & 10 deletions testbed/test_common_request_handler/test_gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ def test_two_callbacks(self):

gevent.joinall([response_greenlet1, response_greenlet2])

self.assertEquals('message1::response', response_greenlet1.get())
self.assertEquals('message2::response', response_greenlet2.get())
self.assertEqual('message1::response', response_greenlet1.get())
self.assertEqual('message2::response', response_greenlet2.get())

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

for span in spans:
self.assertEquals(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)
self.assertEqual(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)

self.assertNotSameTrace(spans[0], spans[1])
self.assertIsNone(spans[0].parent_id)
Expand All @@ -76,10 +76,10 @@ def test_parent_not_picked(self):

with self.tracer.start_active_span('parent'):
response = self.client.send_sync('no_parent')
self.assertEquals('no_parent::response', response)
self.assertEqual('no_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

child_span = get_one_by_operation_name(spans, 'send')
self.assertIsNotNone(child_span)
Expand All @@ -98,13 +98,13 @@ def test_bad_solution_to_set_parent(self):
client = Client(RequestHandler(self.tracer, scope.span.context))
response = client.send_sync('correct_parent')

self.assertEquals('correct_parent::response', response)
self.assertEqual('correct_parent::response', response)

response = client.send_sync('wrong_parent')
self.assertEquals('wrong_parent::response', response)
self.assertEqual('wrong_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 3)
self.assertEqual(len(spans), 3)

spans = sorted(spans, key=lambda x: x.start_time)
parent_span = get_one_by_operation_name(spans, 'parent')
Expand Down
20 changes: 10 additions & 10 deletions testbed/test_common_request_handler/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ def test_two_callbacks(self):
response_future1 = self.client.send('message1')
response_future2 = self.client.send('message2')

self.assertEquals('message1::response', response_future1.result(5.0))
self.assertEquals('message2::response', response_future2.result(5.0))
self.assertEqual('message1::response', response_future1.result(5.0))
self.assertEqual('message2::response', response_future2.result(5.0))

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

for span in spans:
self.assertEquals(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)
self.assertEqual(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)

self.assertNotSameTrace(spans[0], spans[1])
self.assertIsNone(spans[0].parent_id)
Expand All @@ -75,10 +75,10 @@ def test_parent_not_picked(self):

with self.tracer.start_active_span('parent'):
response = self.client.send_sync('no_parent')
self.assertEquals('no_parent::response', response)
self.assertEqual('no_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

child_span = get_one_by_operation_name(spans, 'send')
self.assertIsNotNone(child_span)
Expand All @@ -97,13 +97,13 @@ def test_bad_solution_to_set_parent(self):
client = Client(RequestHandler(self.tracer, scope.span.context),
self.executor)
response = client.send_sync('correct_parent')
self.assertEquals('correct_parent::response', response)
self.assertEqual('correct_parent::response', response)

response = client.send_sync('wrong_parent')
self.assertEquals('wrong_parent::response', response)
self.assertEqual('wrong_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 3)
self.assertEqual(len(spans), 3)

spans = sorted(spans, key=lambda x: x.start_time)
parent_span = get_one_by_operation_name(spans, 'parent')
Expand Down
20 changes: 10 additions & 10 deletions testbed/test_common_request_handler/test_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def test_two_callbacks(self):
lambda: len(self.tracer.finished_spans()) >= 2)
self.loop.start()

self.assertEquals('message1::response', res_future1.result())
self.assertEquals('message2::response', res_future2.result())
self.assertEqual('message1::response', res_future1.result())
self.assertEqual('message2::response', res_future2.result())

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

for span in spans:
self.assertEquals(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)
self.assertEqual(span.tags.get(tags.SPAN_KIND, None),
tags.SPAN_KIND_RPC_CLIENT)

self.assertNotSameTrace(spans[0], spans[1])
self.assertIsNone(spans[0].parent_id)
Expand All @@ -87,10 +87,10 @@ def test_parent_not_picked(self):
with tracer_stack_context():
with self.tracer.start_active_span('parent'):
response = self.client.send_sync('no_parent')
self.assertEquals('no_parent::response', response)
self.assertEqual('no_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 2)
self.assertEqual(len(spans), 2)

child_span = get_one_by_operation_name(spans, 'send')
self.assertIsNotNone(child_span)
Expand All @@ -112,14 +112,14 @@ def test_good_solution_to_set_parent(self):
client = Client(req_handler, self.loop)
response = client.send_sync('correct_parent')

self.assertEquals('correct_parent::response', response)
self.assertEqual('correct_parent::response', response)

# Should NOT be a child of the previously activated Span
response = client.send_sync('wrong_parent')
self.assertEquals('wrong_parent::response', response)
self.assertEqual('wrong_parent::response', response)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 3)
self.assertEqual(len(spans), 3)

spans = sorted(spans, key=lambda x: x.start_time)
parent_span = get_one_by_operation_name(spans, 'parent')
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_listener_per_request/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUp(self):
def test_main(self):
client = Client(self.tracer, self.loop)
res = client.send_sync('message')
self.assertEquals(res, 'message::response')
self.assertEqual(res, 'message::response')

spans = self.tracer.finished_spans()
self.assertEqual(len(spans), 1)
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_listener_per_request/test_gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUp(self):
def test_main(self):
client = Client(self.tracer)
res = client.send_sync('message')
self.assertEquals(res, 'message::response')
self.assertEqual(res, 'message::response')

spans = self.tracer.finished_spans()
self.assertEqual(len(spans), 1)
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_listener_per_request/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUp(self):
def test_main(self):
client = Client(self.tracer)
res = client.send_sync('message')
self.assertEquals(res, 'message::response')
self.assertEqual(res, 'message::response')

spans = self.tracer.finished_spans()
self.assertEqual(len(spans), 1)
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_listener_per_request/test_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setUp(self):
def test_main(self):
client = Client(self.tracer, self.loop)
res = client.send_sync('message')
self.assertEquals(res, 'message::response')
self.assertEqual(res, 'message::response')

spans = self.tracer.finished_spans()
self.assertEqual(len(spans), 1)
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_multiple_callbacks/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def main_task():
self.loop.run_forever()

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 4)
self.assertEqual(len(spans), 4)
self.assertNamesEqual(spans, ['task', 'task', 'task', 'parent'])

for i in range(3):
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_multiple_callbacks/test_gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main_task():
gevent.wait(timeout=5.0)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 4)
self.assertEqual(len(spans), 4)
self.assertNamesEqual(spans, ['task', 'task', 'task', 'parent'])

for i in range(3):
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_multiple_callbacks/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_main(self):
self.executor.shutdown(True)

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 4)
self.assertEqual(len(spans), 4)
self.assertNamesEqual(spans, ['task', 'task', 'task', 'parent'])

for i in range(3):
Expand Down
2 changes: 1 addition & 1 deletion testbed/test_multiple_callbacks/test_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main_task():
self.loop.start()

spans = self.tracer.finished_spans()
self.assertEquals(len(spans), 4)
self.assertEqual(len(spans), 4)
self.assertNamesEqual(spans, ['task', 'task', 'task', 'parent'])

for i in range(3):
Expand Down