From: Michael Jeanson Date: Thu, 29 Feb 2024 19:42:41 +0000 (-0500) Subject: Tests: standardize TAP_AUTOTIME parsing in python X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6a0d31b579259f816552bae74109ffb204d76b01;p=lttng-tools.git Tests: standardize TAP_AUTOTIME parsing in python Disable TAP autotime only when 'TAP_AUTOTIME == 0'. Also remove the version check as we don't support Python <= 3.3 and there is already an assertion in the code. Change-Id: Idf8badb5a27b1a01cbe7c230495eec342b9c3878 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/tests/utils/lttngtest/tap_generator.py b/tests/utils/lttngtest/tap_generator.py index f2c9fc2b0..e3d61e688 100644 --- a/tests/utils/lttngtest/tap_generator.py +++ b/tests/utils/lttngtest/tap_generator.py @@ -86,7 +86,7 @@ class TapGenerator: self._printed_plan = False # type: bool self._has_failure = False # type: bool self._time_tests = True # type: bool - if os.getenv("TAP_AUTOTIME", "1") == "" or os.getenv("TAP_AUTOTIME", "1") == "0": + if os.getenv("TAP_AUTOTIME", "1") == "0": self._time_tests = False self._last_time = _get_time_ns() diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 30c057bdd..d87cd1e32 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -24,7 +24,7 @@ sys.path.append(lttng_bindings_libs_path) from lttng import * _time_tests = True -if os.getenv("TAP_AUTOTIME", "1") == "" or os.getenv("TAP_AUTOTIME", "1") == "0" or sys.version_info < (3,3,0): +if os.getenv("TAP_AUTOTIME", "1") == "0": _time_tests = False