From 8f328a9eab632c59f79b2373207b67fdaeda9287 Mon Sep 17 00:00:00 2001 From: Bo QIU <35757521+boqiu@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:07:42 +0800 Subject: [PATCH] enhance py test framework to support more args (#19) --- tests/test_framework/test_framework.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/test_framework/test_framework.py b/tests/test_framework/test_framework.py index 2985e3f..bb1ba94 100644 --- a/tests/test_framework/test_framework.py +++ b/tests/test_framework/test_framework.py @@ -175,9 +175,7 @@ class TestFramework: for node in self.nodes: node.wait_for_rpc_connection() - def __parse_arguments(self): - parser = argparse.ArgumentParser(usage="%(prog)s [options]") - + def add_arguments(self, parser: argparse.ArgumentParser): parser.add_argument( "--conflux-binary", dest="conflux", @@ -265,8 +263,6 @@ class TestFramework: help="Attach a python debugger if test fails", ) - self.options = parser.parse_args() - def __start_logging(self): # Add logger and logging handlers self.log = logging.getLogger("TestFramework") @@ -391,7 +387,9 @@ class TestFramework: raise NotImplementedError def main(self): - self.__parse_arguments() + parser = argparse.ArgumentParser(usage="%(prog)s [options]") + self.add_arguments(parser) + self.options = parser.parse_args() PortMin.n = self.options.port_min # Set up temp directory and start logging