Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3e17079

Browse files
committedAug 19, 2021
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 <[email protected]>
1 parent d4d3085 commit 3e17079

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed
 

‎ovn-tester/ovn_context.py

-27
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,6 @@ def __exit__(self, type, value, traceback):
3535
ovn_stats.report(self.test_name, brief=self.brief_report)
3636
print(f'***** Exiting context {self.test_name} *****')
3737

38-
def __iter__(self):
39-
return self
40-
41-
def __next__(self):
42-
now = time.perf_counter()
43-
if self.iteration_start:
44-
duration = now - self.iteration_start
45-
ovn_stats.add(ITERATION_STAT_NAME, duration, failed=self.failed)
46-
print(f'***** Context {self.test_name}, '
47-
f'Iteration {self.iteration}, '
48-
f'Result: {"FAILURE" if self.failed else "SUCCESS"} *****')
49-
self.failed = False
50-
if self.test:
51-
# exec external cmd
52-
# self.test.exec_cmd(self.iteration, self.test_name)
53-
pass
54-
self.iteration_start = now
55-
if self.iteration < self.max_iterations - 1:
56-
self.iteration += 1
57-
print(f'***** Context {self.test_name}, '
58-
f'Iteration {self.iteration} *****')
59-
return self.iteration
60-
raise StopIteration
61-
62-
def fail(self):
63-
self.failed = True
64-
6538
async def iteration_started(self, iteration):
6639
'''Explicitly begin iteration 'n'. This is necessary when running
6740
asynchronously since task starts and ends can overlap.'''

0 commit comments

Comments
 (0)
Please sign in to comment.