[conduit: 86/138] Only use cgitb for unexpected failures (cgitb wasnt so hot for the assert num_of_items == 23 type te
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit: 86/138] Only use cgitb for unexpected failures (cgitb wasnt so hot for the assert num_of_items == 23 type te
- Date: Thu, 21 May 2009 03:34:09 -0400 (EDT)
commit 8741c467ad5a14106ff075844b6527141ae22fbe
Author: John Carr <john carr unrouted co uk>
Date: Mon May 4 09:07:32 2009 -0700
Only use cgitb for unexpected failures (cgitb wasnt so hot for the assert num_of_items == 23 type test cases)
---
test/soup/result.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/test/soup/result.py b/test/soup/result.py
index cc43a95..d43ea77 100644
--- a/test/soup/result.py
+++ b/test/soup/result.py
@@ -5,6 +5,8 @@ from soup.utils import progressbar
import sys
import unittest
import cgitb
+import traceback
+
class TestResult(unittest.TestResult):
@@ -47,6 +49,10 @@ class TestResult(unittest.TestResult):
# Skip test runner traceback levels
while tb and self._is_relevant_tb_level(tb):
tb = tb.tb_next
+ if exctype is test.failureException:
+ # Skip assert*() traceback levels
+ length = self._count_relevant_tb_levels(tb)
+ return ''.join(traceback.format_exception(exctype, value, tb, length))
return cgitb.text((exctype, value, tb))
# FIXME: Maybe these should be callbacks?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]