From 6a0d31b579259f816552bae74109ffb204d76b01 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 29 Feb 2024 14:42:41 -0500 Subject: [PATCH] Tests: standardize TAP_AUTOTIME parsing in python MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- tests/utils/lttngtest/tap_generator.py | 2 +- tests/utils/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.34.1