MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / main

Method main

test/functional/test_framework/test_framework.py:135–160  ·  view source on GitHub ↗

Main function. This should not be overridden by the subclass test scripts.

(self)

Source from the content-addressed store, hash-verified

133 self.rpc_timeout = int(self.rpc_timeout * self.options.timeout_factor) # optionally, increase timeout by a factor
134
135 def main(self):
136 """Main function. This should not be overridden by the subclass test scripts."""
137
138 assert hasattr(self, "num_nodes"), "Test must set self.num_nodes in set_test_params()"
139
140 try:
141 self.setup()
142 if self.options.test_methods:
143 self.run_test_methods()
144 else:
145 self.run_test()
146
147 except SkipTest as e:
148 self.log.warning("Test Skipped: %s" % e.message)
149 self.success = TestStatus.SKIPPED
150 except subprocess.CalledProcessError as e:
151 self.log.exception(f"Called Process failed with stdout='{e.stdout}'; stderr='{e.stderr}';")
152 self.success = TestStatus.FAILED
153 except BaseException:
154 # The `exception` log will add the exception info to the message.
155 # https://docs.python.org/3/library/logging.html#logging.exception
156 self.log.exception("Unexpected exception:")
157 self.success = TestStatus.FAILED
158 finally:
159 exit_code = self.shutdown()
160 sys.exit(exit_code)
161
162 def run_test_methods(self):
163 for method_name in self.options.test_methods:

Callers 15

asmap.pyFile · 0.80
tool_utils.pyFile · 0.80
p2p_sendheaders.pyFile · 0.80
wallet_timelock.pyFile · 0.80
rpc_net.pyFile · 0.80
mempool_reorg.pyFile · 0.80
mempool_accept.pyFile · 0.80
p2p_timeouts.pyFile · 0.80
mempool_limit.pyFile · 0.80

Calls 4

setupMethod · 0.95
run_test_methodsMethod · 0.95
run_testMethod · 0.95
shutdownMethod · 0.95

Tested by

no test coverage detected