summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-21 09:28:32 -0800
committerOle Trøan <otroan@employees.org>2018-11-26 08:58:22 +0000
commit86ebba6b3f99bb672126338ac3f549978b5ef01d (patch)
treee3243d2821b3270a1f81c151ac172f79e313805f
parent72f0004ac5f6e201cbe042593d76df6f2491d743 (diff)
Fix swapped decorators in VppTestCase.
Change-Id: I39b5a8e368f0e0b5c83203141d01f22d909b6f9d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--test/framework.py10
1 files 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: