Fix swapped decorators in VppTestCase.

Change-Id: I39b5a8e368f0e0b5c83203141d01f22d909b6f9d
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:
Paul Vinciguerra
2018-11-21 09:28:32 -08:00
committed by Ole Trøan
parent 72f0004ac5
commit 86ebba6b3f

View File

@ -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: