Merge lp:~rvb/maas-test/cleanup-control-c into lp:maas-test
Status: | Merged |
---|---|
Approved by: | Raphaël Badin |
Approved revision: | 83 |
Merged at revision: | 82 |
Proposed branch: | lp:~rvb/maas-test/cleanup-control-c |
Merge into: | lp:maas-test |
Diff against target: |
19 lines (+8/-1) 1 file modified
maastest/main.py (+8/-1) |
To merge this branch: | bzr merge lp:~rvb/maas-test/cleanup-control-c |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+197832@code.launchpad.net |
Commit message
Call tearDownClass when KeyboardInterrupt is raised.
Description of the change
The VM machine (and other resources) were not cleaned up with a user hit control-c when the tests are running (note that everything is cleaned up all right if control-c is hit during the preparation phase — i.e. when the fixtures are being created).
I looked into using unittest.
This is a band-aid, but then unittest seems to have devolved into a mess; it's hard to do the right thing. This does miss out on test-level and module-level tearDowns, but it's an improvement nonetheless. Perhaps you could add a comment about that to the code?