Skip to content

Commit

Permalink
ovn-tester: Remove unused __iter__ and __next__ from Context.
Browse files Browse the repository at this point in the history
With the switch to asynchronous code, these methods are no longer used
and they're no longer useful. Remove.

Signed-off-by: Mark Michelson <[email protected]>
  • Loading branch information
putnopvut committed Aug 24, 2021
1 parent edb22f8 commit 392401a
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions ovn-tester/ovn_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,6 @@ def __exit__(self, type, value, traceback):
ovn_stats.report(self.test_name, brief=self.brief_report)
print(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)
print(f'***** Context {self.test_name}, '
f'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
print(f'***** Context {self.test_name}, '
f'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.'''
Expand Down

0 comments on commit 392401a

Please sign in to comment.