Fix: bt2: pass _TraceClassConst to destruction listeners
[babeltrace.git] / tests / bindings / python / bt2 / test_trace.py
index e7aa18be209ca0d50d0350e9f4ec1746ad9a23ed..0ce6e1358a89c886043e9eb7545b4ef55300a1e2 100644 (file)
@@ -137,11 +137,15 @@ class TraceTestCase(unittest.TestCase):
             num_trace_class_destroyed_calls += 1
 
         def on_trace_destruction(trace):
+            nonlocal type_of_passed_trace
+            type_of_passed_trace = type(trace)
+
             nonlocal num_trace_destroyed_calls
             num_trace_destroyed_calls += 1
 
         num_trace_class_destroyed_calls = 0
         num_trace_destroyed_calls = 0
+        type_of_passed_trace = None
 
         trace_class = get_default_trace_class()
         stream_class = trace_class.create_stream_class()
@@ -168,6 +172,7 @@ class TraceTestCase(unittest.TestCase):
 
         self.assertEqual(num_trace_class_destroyed_calls, 0)
         self.assertEqual(num_trace_destroyed_calls, 1)
+        self.assertIs(type_of_passed_trace, bt2_trace._TraceConst)
 
         del trace_class
 
This page took 0.023421 seconds and 4 git commands to generate.