summaryrefslogtreecommitdiff
path: root/pecan/tests/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'pecan/tests/test_base.py')
-rw-r--r--pecan/tests/test_base.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pecan/tests/test_base.py b/pecan/tests/test_base.py
index e6adf0e..785b522 100644
--- a/pecan/tests/test_base.py
+++ b/pecan/tests/test_base.py
@@ -3,6 +3,7 @@
import sys
import os
import json
+import traceback
import warnings
import webob
@@ -1121,6 +1122,20 @@ class TestAbort(PecanTestCase):
r = app.get('/', status=401)
assert r.status_int == 401
+ def test_abort_keeps_traceback(self):
+ last_exc, last_traceback = None, None
+
+ try:
+ try:
+ raise Exception('Bottom Exception')
+ except:
+ abort(404)
+ except Exception:
+ last_exc, _, last_traceback = sys.exc_info()
+
+ assert last_exc is HTTPNotFound
+ assert 'Bottom Exception' in traceback.format_tb(last_traceback)[-1]
+
class TestScriptName(PecanTestCase):