From d47d404e557333e29cdb07fd4c1ce2d90c403110 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 5 Sep 2018 17:31:23 +0000 Subject: tests: print failed testname instead of docstring upon failure --- cloudinit/tests/helpers.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cloudinit/tests') 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""" -- cgit v1.2.3