summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-02 12:49:57 -0500
committerEric Eastwood <erice@element.io>2022-08-02 12:49:57 -0500
commit0f93ec8d590c447339cc735c05eab0577a68adcd (patch)
tree4631aacfc7701295a6a981cc0b9d321681362a44 /tests
parentRevert crazy custom sampler and span process to try force tracing for users (diff)
downloadsynapse-0f93ec8d590c447339cc735c05eab0577a68adcd.tar.xz
Fix lints
Diffstat (limited to 'tests')
-rw-r--r--tests/logging/test_tracing.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/logging/test_tracing.py b/tests/logging/test_tracing.py
index 59529c9d01..98a37e5235 100644
--- a/tests/logging/test_tracing.py
+++ b/tests/logging/test_tracing.py
@@ -64,13 +64,13 @@ class TracingTestCase(TestCase):
         # start_active_span should start and activate a span.
         with start_active_span("new-span", tracer=self._tracer) as span:
             self.assertEqual(opentelemetry.trace.get_current_span(), span)
-            self.assertIsNotNone(span.start_time)
+            self.assertIsNotNone(span.start_time)  # type: ignore[attr-defined]
 
         # ... but leaving it unsets the active span, and finishes the span.
         self.assertEqual(
             opentelemetry.trace.get_current_span(), opentelemetry.trace.INVALID_SPAN
         )
-        self.assertIsNotNone(span.end_time)
+        self.assertIsNotNone(span.end_time)  # type: ignore[attr-defined]
 
         # the span should have been reported
         self.assertListEqual(
@@ -92,7 +92,10 @@ class TracingTestCase(TestCase):
                     child_span1,
                     "child_span1 was not activated",
                 )
-                self.assertEqual(child_span1.parent.span_id, root_context.span_id)
+                self.assertEqual(
+                    child_span1.parent.span_id,  # type: ignore[attr-defined]
+                    root_context.span_id,
+                )
 
                 with start_active_span(
                     "child_span2",
@@ -102,14 +105,14 @@ class TracingTestCase(TestCase):
                         opentelemetry.trace.get_current_span(), child_span2
                     )
                     self.assertEqual(
-                        child_span2.parent.span_id,
+                        child_span2.parent.span_id,  # type: ignore[attr-defined]
                         child_span1.get_span_context().span_id,
                     )
 
             # the root scope should be restored
             self.assertEqual(opentelemetry.trace.get_current_span(), root_span)
-            self.assertIsNotNone(child_span1.end_time)
-            self.assertIsNotNone(child_span2.end_time)
+            self.assertIsNotNone(child_span1.end_time)  # type: ignore[attr-defined]
+            self.assertIsNotNone(child_span2.end_time)  # type: ignore[attr-defined]
 
         # Active span is unset now that we're outside of the `with` scopes
         self.assertEqual(