From 86ebba6b3f99bb672126338ac3f549978b5ef01d Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Wed, 21 Nov 2018 09:28:32 -0800 Subject: [PATCH] Fix swapped decorators in VppTestCase. Change-Id: I39b5a8e368f0e0b5c83203141d01f22d909b6f9d Signed-off-by: Paul Vinciguerra --- test/framework.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/framework.py b/test/framework.py index d985ac6439d..4fefc043264 100644 --- a/test/framework.py +++ b/test/framework.py @@ -224,8 +224,8 @@ class VppTestCase(unittest.TestCase): else: raise Exception("Unrecognized DEBUG option: '%s'" % d) - @classmethod - def get_least_used_cpu(self): + @staticmethod + def get_least_used_cpu(): cpu_usage_list = [set(range(psutil.cpu_count()))] vpp_processes = [p for p in psutil.process_iter(attrs=['pid', 'name']) if 'vpp_main' == p.info['name']] @@ -253,7 +253,7 @@ class VppTestCase(unittest.TestCase): return random.choice(tuple(min_usage_set)) - @staticmethod + @classmethod def print_header(cls): if not hasattr(cls, '_header_printed'): print(double_line_delim) @@ -380,7 +380,7 @@ class VppTestCase(unittest.TestCase): """ gc.collect() # run garbage collection first random.seed() - cls.print_header(cls) + cls.print_header() cls.logger = get_logger(cls.__name__) if hasattr(cls, 'parallel_handler'): cls.logger.addHandler(cls.parallel_handler) @@ -1190,7 +1190,7 @@ class VppTestResult(unittest.TestResult): :param test: """ - test.print_header(test.__class__) + test.print_header() unittest.TestResult.startTest(self, test) if self.verbosity > 0: -- 2.16.6