enhance py test framework to support more args (#19)

This commit is contained in:
Bo QIU 2024-02-04 15:07:42 +08:00 committed by GitHub
parent 80cebd4c70
commit 8f328a9eab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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