From 47186253888b62a9b4cfa1ab0965f9a39f887c33 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Thu, 2 Nov 2017 13:53:35 +0100 Subject: [PATCH] Avoid exception when failing tests doesn't have a doc string --- system/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/run.py b/system/run.py index 2d4b02c8..8c670177 100755 --- a/system/run.py +++ b/system/run.py @@ -99,7 +99,8 @@ def run(include_long_tests=False, capture_results=False, tests=None, filters=Non print "\nFAILURES (%d):" % (len(fails), ) for (test, t, typ, val, tb, testModule) in fails: - print "%s:%s %s" % (test, t.__class__.__name__, testModule.__name__ + ": " + t.__doc__.strip()) + doc = t.__doc__ or '' + print "%s:%s %s" % (test, t.__class__.__name__, testModule.__name__ + ": " + doc.strip()) traceback.print_exception(typ, val, tb) print "=" * 60