diff options
author | John Szakmeister <john@szakmeister.net> | 2013-02-08 12:46:06 -0800 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2013-02-08 12:46:06 -0800 |
commit | 27821d914e738f5360cc4a508e133e86004e8bf1 (patch) | |
tree | a7925df24475ef3c9c1f4998221cd537a872e44e /nose/plugins | |
parent | e6fa372ebbe8b08334340ccd50e126a5d8198459 (diff) | |
parent | bf4414002390d5926980736e2ce5ea2dafc3ab82 (diff) | |
download | nose-27821d914e738f5360cc4a508e133e86004e8bf1.tar.gz |
Merge pull request #603 from saschpe/master-plugin-failuredetail-no-tb
Fix formatFailure expection if missing tb in exc_info
Diffstat (limited to 'nose/plugins')
-rw-r--r-- | nose/plugins/failuredetail.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nose/plugins/failuredetail.py b/nose/plugins/failuredetail.py index 19569b5..4c0729c 100644 --- a/nose/plugins/failuredetail.py +++ b/nose/plugins/failuredetail.py @@ -38,6 +38,10 @@ class FailureDetail(Plugin): """Add detail from traceback inspection to error message of a failure. """ ec, ev, tb = err - tbinfo = inspect_traceback(tb) + tbinfo, str_ev = None, str(ev) + if tb: + tbinfo = inspect_traceback(tb) + str_ev = '\n'.join([str(ev), tbinfo]) test.tbinfo = tbinfo - return (ec, '\n'.join([str(ev), tbinfo]), tb) + return (ec, str_ev, tb) + |