diff options
Diffstat (limited to 'test/conftest.py')
-rw-r--r-- | test/conftest.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/conftest.py b/test/conftest.py index 9aaf7640..3edc471d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -215,7 +215,7 @@ def run(request): # print unit.log in case of error - if request.node.rep_call.failed: + if hasattr(request.node, 'rep_call') and request.node.rep_call.failed: _print_log() # remove unit.log @@ -284,6 +284,11 @@ def unit_stop(): retcode = p.wait(15) if retcode: return 'Child process terminated with code ' + str(retcode) + + except KeyboardInterrupt: + p.kill() + raise + except: p.kill() return 'Could not terminate unit' @@ -403,6 +408,10 @@ def waitforsocket(port): sock.connect(('127.0.0.1', port)) ret = True break + + except KeyboardInterrupt: + raise + except: sock.close() time.sleep(0.1) |