From da7dd12d2d15ef6d1e3df6f92757ef2cd0f2a01c Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Mon, 9 Aug 2021 08:23:54 -0400 Subject: [PATCH] ovn-tester: Remove unused __iter__ and __next__ from Context. With the switch to asynchronous code, these methods are no longer used and they're no longer useful. Remove. Signed-off-by: Mark Michelson --- ovn-tester/ovn_context.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/ovn-tester/ovn_context.py b/ovn-tester/ovn_context.py index 4aed405c..6c3f0ac7 100644 --- a/ovn-tester/ovn_context.py +++ b/ovn-tester/ovn_context.py @@ -38,32 +38,6 @@ def __exit__(self, type, value, traceback): ovn_stats.report(self.test_name, brief=self.brief_report) log.info(f'Exiting context {self.test_name}') - def __iter__(self): - return self - - def __next__(self): - now = time.perf_counter() - if self.iteration_start: - duration = now - self.iteration_start - ovn_stats.add(ITERATION_STAT_NAME, duration, failed=self.failed) - log.log(logging.WARNING if self.failed else logging.INFO, - f'Context {self.test_name}, Iteration {self.iteration}, ' - f'Result: {"FAILURE" if self.failed else "SUCCESS"}') - self.failed = False - if self.test: - # exec external cmd - # self.test.exec_cmd(self.iteration, self.test_name) - pass - self.iteration_start = now - if self.iteration < self.max_iterations - 1: - self.iteration += 1 - log.info(f'Context {self.test_name}, Iteration {self.iteration}') - return self.iteration - raise StopIteration - - def fail(self): - self.failed = True - async def iteration_started(self, iteration): '''Explicitly begin iteration 'n'. This is necessary when running asynchronously since task starts and ends can overlap.'''