← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~chad.smith/cloud-init:cleanup/test-failures-print-testname into cloud-init:master

 

Chad Smith has proposed merging ~chad.smith/cloud-init:cleanup/test-failures-print-testname into cloud-init:master.

Commit message:
tests: print failed testname instead of docstring upon failure

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/354273
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:cleanup/test-failures-print-testname into cloud-init:master.
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index de24e25..f53ab8f 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
@@ -115,6 +116,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"""

Follow ups