From 7c3bbfd8f1b4e6ba4b27e671349705bd37757e14 Mon Sep 17 00:00:00 2001 From: Ben Copeland Date: Thu, 5 Feb 2026 09:27:13 +0000 Subject: [PATCH] linting: fix black formatting for 26.1.0 Fix Python files failing black --check in CI this is due to black change 26.1.0. Signed-off-by: Ben Copeland --- .../tradefed/tradefed-runner-multinode.py | 2 - .../tradefed-runner.py | 1 - automated/android/tradefed/tradefed-runner.py | 1 - automated/lib/android_adb_wrapper.py | 1 - .../linux/tcpreplay/pcap/generate_pcap.py | 1 - automated/utils/test-runner.py | 49 ++++++------------- plans/testplan2html.py | 1 - 7 files changed, 16 insertions(+), 40 deletions(-) diff --git a/automated/android/multinode/tradefed/tradefed-runner-multinode.py b/automated/android/multinode/tradefed/tradefed-runner-multinode.py index 1b984d68f..440d86e77 100755 --- a/automated/android/multinode/tradefed/tradefed-runner-multinode.py +++ b/automated/android/multinode/tradefed/tradefed-runner-multinode.py @@ -10,7 +10,6 @@ import sys import time - sys.path.insert(0, "../../../lib/") sys.path.insert(1, "../../") import py_test_lib # nopep8 @@ -19,7 +18,6 @@ from multinode.tradefed.utils import * # nopep8 from multinode.tradefed.sts_util import StsUtil # nopep8 - OUTPUT = "%s/output" % os.getcwd() RESULT_FILE = "%s/result.txt" % OUTPUT TRADEFED_STDOUT = "%s/tradefed-stdout.txt" % OUTPUT diff --git a/automated/android/noninteractive-tradefed/tradefed-runner.py b/automated/android/noninteractive-tradefed/tradefed-runner.py index c8d4956ad..608384b08 100755 --- a/automated/android/noninteractive-tradefed/tradefed-runner.py +++ b/automated/android/noninteractive-tradefed/tradefed-runner.py @@ -15,7 +15,6 @@ sys.path.insert(0, "../../lib/") import py_test_lib # nopep8 - OUTPUT = "%s/output" % os.getcwd() RESULT_FILE = "%s/result.txt" % OUTPUT TRADEFED_STDOUT = "%s/tradefed-stdout.txt" % OUTPUT diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py index f1203f327..ec40aaed8 100755 --- a/automated/android/tradefed/tradefed-runner.py +++ b/automated/android/tradefed/tradefed-runner.py @@ -16,7 +16,6 @@ sys.path.insert(0, "../../lib/") import py_test_lib # nopep8 - OUTPUT = "%s/output" % os.getcwd() RESULT_FILE = "%s/result.txt" % OUTPUT TRADEFED_STDOUT = "%s/tradefed-stdout.txt" % OUTPUT diff --git a/automated/lib/android_adb_wrapper.py b/automated/lib/android_adb_wrapper.py index 15092aa77..5e83f4eef 100644 --- a/automated/lib/android_adb_wrapper.py +++ b/automated/lib/android_adb_wrapper.py @@ -4,7 +4,6 @@ import subprocess import time - ADB_DEVICES_PATTERN = re.compile(r"^([a-z0-9-]+)\s+device$", flags=re.M) diff --git a/automated/linux/tcpreplay/pcap/generate_pcap.py b/automated/linux/tcpreplay/pcap/generate_pcap.py index 1666b1b49..08d6d4b2c 100755 --- a/automated/linux/tcpreplay/pcap/generate_pcap.py +++ b/automated/linux/tcpreplay/pcap/generate_pcap.py @@ -14,7 +14,6 @@ fragment, ) - test_expectations = { "tcp_basic.pcap": "pass", "tcp_data.pcap": "pass", diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py index 751833201..2720b80a8 100755 --- a/automated/utils/test-runner.py +++ b/automated/utils/test-runner.py @@ -17,7 +17,6 @@ from uuid import uuid4 from datetime import datetime - try: from squad_client.core.api import SquadApi from squad_client.shortcuts import submit_results @@ -1122,37 +1121,31 @@ def get_args(): "--output", default=os.getenv("HOME", "") + "/output", dest="output", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ specify a directory to store test and result files. Default: $HOME/output - """ - ), + """), ) parser.add_argument( "-p", "--test_plan", default=None, dest="test_plan", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ specify a test plan file which has tests and related params listed in yaml format. - """ - ), + """), ) parser.add_argument( "-d", "--test_def", default=None, dest="test_def", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ base on test definition repo location, specify relative path to the test definition to run. Format example: "ubuntu/smoke-tests-basic.yaml" - """ - ), + """), ) parser.add_argument( "-r", @@ -1162,14 +1155,12 @@ def get_args(): action=StoreDictKeyPair, nargs="+", metavar="KEY=VALUE", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ Set additional parameters when using test definition without a test plan. The name values are set similarily to environment variables: --test_def_params KEY1=VALUE1 KEY2=VALUE2 ... - """ - ), + """), ) parser.add_argument( "-k", @@ -1177,12 +1168,10 @@ def get_args(): default="automated", dest="kind", choices=["automated", "manual"], - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ Selects type of tests to be executed from the test plan. Possible options: automated, manual - """ - ), + """), ) parser.add_argument( "-t", @@ -1197,13 +1186,11 @@ def get_args(): "--target", default=None, dest="target", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ Specify SSH target to execute tests. Format: user@host Note: ssh authentication must be paswordless - """ - ), + """), ) parser.add_argument( "-s", @@ -1234,14 +1221,12 @@ def get_args(): "--overlay", default=None, dest="overlay", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ Specify test plan overlay file to: * skip tests * amend test parameters * add new tests - """ - ), + """), ) parser.add_argument( "-v", @@ -1314,14 +1299,12 @@ def get_args(): dest="cleanup", default=False, action="store_true", - help=textwrap.dedent( - """\ + help=textwrap.dedent("""\ If set to true, test-runner will remove all temporary files after running the test. It includes all collected logs and test results. This option should only be used if uploading results to SQUAD or LAVA. Default: false - """ - ), + """), ) args = parser.parse_args() diff --git a/plans/testplan2html.py b/plans/testplan2html.py index b3ac41071..a4cc7a665 100755 --- a/plans/testplan2html.py +++ b/plans/testplan2html.py @@ -11,7 +11,6 @@ from csv import DictWriter from jinja2 import Environment, FileSystemLoader - logger = logging.getLogger()