Move argparse() to init()

This ensures TestFramework default parameters are set before setup is called. A
 child class will therefore have access to defaults when overriding setup.
This commit is contained in:
JamesC 2019-10-31 12:01:58 +01:00 committed by James Chiang
parent 2ab01462f4
commit 5155602a63

View file

@ -99,14 +99,13 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.supports_cli = False
self.bind_to_localhost_only = True
self.set_test_params()
self.parse_args()
def main(self):
"""Main function. This should not be overridden by the subclass test scripts."""
assert hasattr(self, "num_nodes"), "Test must set self.num_nodes in set_test_params()"
self.parse_args()
try:
self.setup()
self.run_test()