mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
functional_tests: ensure mining stops on error in mining test
this prevents messing up any subsequent test too
This commit is contained in:
parent
b928ead30e
commit
261abf79e1
1 changed files with 11 additions and 1 deletions
|
@ -170,5 +170,15 @@ class MiningTest():
|
||||||
assert res.hash == block_hash
|
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__':
|
if __name__ == '__main__':
|
||||||
|
with Guard() as guard:
|
||||||
MiningTest().run_test()
|
MiningTest().run_test()
|
||||||
|
|
Loading…
Reference in a new issue