summaryrefslogtreecommitdiff
path: root/tests/cloud_tests/testcases/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-10-20 14:58:24 -0400
committerScott Moser <smoser@brickies.net>2017-10-20 16:03:14 -0400
commita51968d50e7cdecabaf255c26386fd82f6640cc3 (patch)
tree107a9d507ff62ea4b735e0b0eaa538425ad60a5d /tests/cloud_tests/testcases/__init__.py
parent6bc504e41666329631cdfd5b947ed5b0e2529a76 (diff)
downloadvyos-cloud-init-a51968d50e7cdecabaf255c26386fd82f6640cc3.tar.gz
vyos-cloud-init-a51968d50e7cdecabaf255c26386fd82f6640cc3.zip
citest: show the class actual class name in results.
Tests are currently run by creating a temporary subclass of each class and then executing it (in get_suites). When running the tests suite the output would contain the temporary class name. That was less than useful, and made batch runs almost impossible to identify which test case had an error. This change goes from output of: FAIL: test_no_warnings_in_log \ (tests.cloud_tests.testcases.get_suite.<locals>.tmp) To FAIL: test_no_warnings_in_log \ (tests.cloud_tests.testcases.modules.ntp.TestNtp)
Diffstat (limited to 'tests/cloud_tests/testcases/__init__.py')
-rw-r--r--tests/cloud_tests/testcases/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/cloud_tests/testcases/__init__.py b/tests/cloud_tests/testcases/__init__.py
index 47217ce6..a29a0928 100644
--- a/tests/cloud_tests/testcases/__init__.py
+++ b/tests/cloud_tests/testcases/__init__.py
@@ -5,6 +5,7 @@
import importlib
import inspect
import unittest
+from unittest.util import strclass
from tests.cloud_tests import config
from tests.cloud_tests.testcases.base import CloudTestCase as base_test
@@ -37,6 +38,12 @@ def get_suite(test_name, data, conf):
class tmp(test_class):
+ _realclass = test_class
+
+ def __str__(self):
+ return "%s (%s)" % (self._testMethodName,
+ strclass(self._realclass))
+
@classmethod
def setUpClass(cls):
cls.data = data