aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/mining.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional_tests/mining.py')
-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()