summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-09-05 17:31:23 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2018-09-05 17:31:23 +0000
commitd47d404e557333e29cdb07fd4c1ce2d90c403110 (patch)
treee0699d0b09d26ec81f507320b2d3b02b1e76ba2c
parenta8dcad9ac62bb1d2a4f7489960395bad6cac9382 (diff)
downloadcloud-init-git-d47d404e557333e29cdb07fd4c1ce2d90c403110.tar.gz
tests: print failed testname instead of docstring upon failure
-rw-r--r--cloudinit/tests/helpers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index e7e4182f..42f56c27 100644
--- a/cloudinit/tests/helpers.py
+++ b/cloudinit/tests/helpers.py
@@ -14,6 +14,7 @@ import time
import mock
import six
import unittest2
+from unittest2.util import strclass
try:
from contextlib import ExitStack, contextmanager
@@ -117,6 +118,9 @@ class TestCase(unittest2.TestCase):
super(TestCase, self).setUp()
self.reset_global_state()
+ def shortDescription(self):
+ return strclass(self.__class__) + '.' + self._testMethodName
+
def add_patch(self, target, attr, *args, **kwargs):
"""Patches specified target object and sets it as attr on test
instance also schedules cleanup"""