aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-12-12 13:41:05 -0600
committerluigi1111 <luigi1111w@gmail.com>2019-12-12 13:41:05 -0600
commita6fa7d493ec2f3784a90c61395e4cc1b3b25ad29 (patch)
tree093d897f0c134566cbbf324e6640c9ecb180dc8f
parentMerge pull request #6037 (diff)
parentfunctional_tests: ensure mining stops on error in mining test (diff)
downloadmonero-a6fa7d493ec2f3784a90c61395e4cc1b3b25ad29.tar.xz
Merge pull request #6041
261abf7 functional_tests: ensure mining stops on error in mining test (moneromooo-monero)
-rwxr-xr-xtests/functional_tests/mining.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/functional_tests/mining.py b/tests/functional_tests/mining.py
index ad646417e..d067c25e1 100755
--- a/tests/functional_tests/mining.py
+++ b/tests/functional_tests/mining.py
@@ -170,5 +170,15 @@ class MiningTest():
assert res.hash == block_hash
+class Guard:
+ def __enter__(self):
+ pass
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ daemon = Daemon()
+ try: daemon.stop_mining()
+ except: pass
+
if __name__ == '__main__':
- MiningTest().run_test()
+ with Guard() as guard:
+ MiningTest().run_test()