X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fcontext%2Ftest_ust.py;h=fac8ca15a24e2421addcd6a192e91f5e1c43e77e;hb=f38b11e104c2f6e916f83617f14e643e73ca917b;hp=ab2e743e3570d94b89371514d9372ff9bf6c2b2e;hpb=63c98ca6e4916610d7d98bd153bba8e2c90e6483;p=lttng-tools.git diff --git a/tests/regression/tools/context/test_ust.py b/tests/regression/tools/context/test_ust.py index ab2e743e3..fac8ca15a 100755 --- a/tests/regression/tools/context/test_ust.py +++ b/tests/regression/tools/context/test_ust.py @@ -4,7 +4,6 @@ # # SPDX-License-Identifier: GPL-2.0-only -from cgi import test import pathlib import sys import os @@ -29,7 +28,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 +46,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 +68,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 +80,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__