Move assert num_nodes is set into main()
This allows a BitcoinTestFramework child class to set test parameters in an overridden setup() rather than in an overridden set_test_params().
This commit is contained in:
1 parent
614c645643
commit
2ab01462f4
1 file changed
+2
-2
@@ -100,11 +100,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
self.bind_to_localhost_only = True
|
self.bind_to_localhost_only = True
|
||||||
self.set_test_params()
|
self.set_test_params()
|
||||||
|
|
||||||
assert hasattr(self, "num_nodes"), "Test must set self.num_nodes in set_test_params()"
|
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
"""Main function. This should not be overridden by the subclass test scripts."""
|
"""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()
|
self.parse_args()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in new issue
Block a user