diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-12-12 13:41:05 -0600 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-12-12 13:41:05 -0600 |
commit | a6fa7d493ec2f3784a90c61395e4cc1b3b25ad29 (patch) | |
tree | 093d897f0c134566cbbf324e6640c9ecb180dc8f /tests | |
parent | Merge pull request #6037 (diff) | |
parent | functional_tests: ensure mining stops on error in mining test (diff) | |
download | monero-a6fa7d493ec2f3784a90c61395e4cc1b3b25ad29.tar.xz |
Merge pull request #6041
261abf7 functional_tests: ensure mining stops on error in mining test (moneromooo-monero)
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/functional_tests/mining.py | 12 |
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() |