summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Qiu <kevin@freshbooks.com>2013-05-02 23:07:58 -0400
committerKevin Qiu <kevin@freshbooks.com>2013-05-02 23:07:58 -0400
commit8fbf666ee364ea0828fbc76ea137e274b1adb83c (patch)
treedac26ee028af527422f5cb298b36bb5bb0a0a176
parentf59cda79adc4dfa87c40a3f7939e21533caab186 (diff)
downloadnose-8fbf666ee364ea0828fbc76ea137e274b1adb83c.tar.gz
Catch KeyboardInterrupt during test run...
...so that one can ^C a test run and still get a report of failed tests and stack traces.
-rw-r--r--nose/core.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nose/core.py b/nose/core.py
index e57a88f..0e0d15a 100644
--- a/nose/core.py
+++ b/nose/core.py
@@ -58,7 +58,10 @@ class TextTestRunner(unittest.TextTestRunner):
result = self._makeResult()
start = time.time()
- test(result)
+ try:
+ test(result)
+ except KeyboardInterrupt:
+ pass
stop = time.time()
result.printErrors()
result.printSummary(start, stop)