X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fframework.py;h=3c4aacb635498359c2ff23053dec1035cfefda52;hb=ccfead6e12f5d5a124e1e279a5b74361e00e2de8;hp=019f366dabe1192331c29ab3b99d5a854647a902;hpb=c32023b9fd6970ed1cac1b3c7f36233b536d9968;p=vpp.git diff --git a/test/framework.py b/test/framework.py index 019f366dabe..3c4aacb6354 100644 --- a/test/framework.py +++ b/test/framework.py @@ -379,6 +379,7 @@ class VppTestCase(unittest.TestCase): cls.logger = get_logger(cls.__name__) if hasattr(cls, 'parallel_handler'): cls.logger.addHandler(cls.parallel_handler) + cls.logger.propagate = False cls.tempdir = tempfile.mkdtemp( prefix='vpp-unittest-%s-' % cls.__name__) cls.stats_sock = "%s/stats.sock" % cls.tempdir @@ -983,6 +984,14 @@ def get_testcase_doc_name(test): return getdoc(test.__class__).splitlines()[0] +def get_test_description(descriptions, test): + short_description = test.shortDescription() + if descriptions and short_description: + return short_description + else: + return str(test) + + class TestCaseInfo(object): def __init__(self, logger, tempdir, vpp_pid, vpp_bin_path): self.logger = logger @@ -1167,12 +1176,7 @@ class VppTestResult(unittest.TestResult): :returns: test description """ - # TODO: if none print warning not raise exception - short_description = test.shortDescription() - if self.descriptions and short_description: - return short_description - else: - return str(test) + return get_test_description(self.descriptions, test) def startTest(self, test): """ @@ -1251,8 +1255,7 @@ class VppTestRunner(unittest.TextTestRunner): super(VppTestRunner, self).__init__(sys.stdout, descriptions, verbosity, failfast, buffer, resultclass) - reporter = KeepAliveReporter() - reporter.pipe = keep_alive_pipe + KeepAliveReporter.pipe = keep_alive_pipe VppTestResult.test_framework_result_pipe = result_pipe