Tests: python: use quoted annotations to support python <= 3.6
[lttng-tools.git] / tests / regression / tools / context / test_ust.py
index ab2e743e3570d94b89371514d9372ff9bf6c2b2e..b90291fa5b8130be0b8a423b3fb3bbbff03cc9c7 100755 (executable)
@@ -29,7 +29,8 @@ import lttngtest
 import bt2
 
 
-def context_trace_field_name(context_type: Type[lttngtest.ContextType]) -> str:
+def context_trace_field_name(context_type):
+    # type: (Type[lttngtest.ContextType]) -> str
     if isinstance(context_type, lttngtest.VpidContextType):
         return "vpid"
     elif isinstance(context_type, lttngtest.VuidContextType):
@@ -46,8 +47,9 @@ def context_trace_field_name(context_type: Type[lttngtest.ContextType]) -> str:
 
 
 def trace_stream_class_has_context_field_in_event_context(
-    trace_location: pathlib.Path, context_field_name: str
-) -> bool:
+    trace_location, context_field_name
+):
+    # type: (pathlib.Path, str) -> bool
     iterator = bt2.TraceCollectionMessageIterator(str(trace_location))
 
     # A bt2 message sequence is guaranteed to begin with a StreamBeginningMessage.
@@ -67,9 +69,8 @@ def trace_stream_class_has_context_field_in_event_context(
     return context_field_name in event_common_context_field_class
 
 
-def trace_events_have_context_value(
-    trace_location: pathlib.Path, context_field_name: str, value: Any
-) -> bool:
+def trace_events_have_context_value(trace_location, context_field_name, value):
+    # type: (pathlib.Path, str, Any) -> bool
     for msg in bt2.TraceCollectionMessageIterator(str(trace_location)):
         if type(msg) is not bt2._EventMessageConst:
             continue
@@ -80,12 +81,8 @@ def trace_events_have_context_value(
     return True
 
 
-def test_static_context(
-    tap: lttngtest.TapGenerator,
-    test_env: lttngtest._Environment,
-    context_type: lttngtest.ContextType,
-    context_value_retriever: Callable[[lttngtest.WaitTraceTestApplication], Any],
-) -> None:
+def test_static_context(tap, test_env, context_type, context_value_retriever):
+    # type: (lttngtest.TapGenerator, lttngtest._Environment, lttngtest.ContextType, Callable[[lttngtest.WaitTraceTestApplication], Any]) -> None
     tap.diagnostic(
         "Test presence and expected value of context `{context_name}`".format(
             context_name=type(context_type).__name__
This page took 0.028561 seconds and 4 git commands to generate.