From ebe046f19dbc8f8708c4f549ed114759391174d3 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Fri, 5 Jul 2024 15:10:01 +0800 Subject: [PATCH] runtests.py: refine the coding style Signed-off-by: Yi Sun --- BM/runtests.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BM/runtests.py b/BM/runtests.py index c2e3c28d..d6511015 100755 --- a/BM/runtests.py +++ b/BM/runtests.py @@ -1,17 +1,19 @@ #!/usr/bin/python3 -import sys +from avocado.core.nrunner.runnable import Runnable +from avocado.core.suite import TestSuite +from avocado.core.job import Job import subprocess import argparse -import os import shlex -from avocado.core.job import Job -from avocado.core.nrunner.runnable import Runnable -from avocado.core.suite import TestSuite +import sys +import os # Parse command line arguments. -parser = argparse.ArgumentParser(description='Run tests from a list in a file(tests/tests-client/tests-server).') -parser.add_argument('-f', '--feature', help='Directory of a feature to run the tests') -parser.add_argument('-t', '--tests', help='Path to a test file containing the list of tests to run') +parser = argparse.ArgumentParser(description='Run tests from a list in a file(tests).') +parser.add_argument('-f', '--feature', required=True, + help='Directory of a feature to run the tests') +parser.add_argument('-t', '--tests', required=True, + help='Path to a test file containing the list of tests to run') args = parser.parse_args() BM_dir = os.path.dirname(os.path.realpath(__file__))