diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-27 16:20:13 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-27 16:21:30 +0000 |
commit | 261abf79e1c0faed88e1c4f14fdd925586f776b3 (patch) | |
tree | 754ed8cded621889df270eb19b39ec180956237e /tests/functional_tests/mining.py | |
parent | Merge pull request #6036 (diff) | |
download | monero-261abf79e1c0faed88e1c4f14fdd925586f776b3.tar.xz |
functional_tests: ensure mining stops on error in mining test
this prevents messing up any subsequent test too
Diffstat (limited to '')
-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() |