Skip to content
Snippets Groups Projects
Commit 081efcce authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix tests

parent 776796f5
No related branches found
No related tags found
No related merge requests found
......@@ -12,29 +12,32 @@ IteratorOrIterable = tp.Union[tp.Iterator[T], tp.Iterable[T]]
@for_argument(iter)
@silence_excs(StopIteration)
def even(sq: IteratorOrIterable) -> tp.Iterator[T]:
"""
Return only elements with even indices in this iterable (first element will be returned,
as indices are counted from 0)
"""
while True:
yield next(sq)
next(sq)
try:
while True:
yield next(sq)
next(sq)
except StopIteration:
return
@for_argument(iter)
@silence_excs(StopIteration)
def odd(sq: IteratorOrIterable) -> tp.Iterator[T]:
"""
Return only elements with odd indices in this iterable.
"""
while True:
next(sq)
yield next(sq)
try:
while True:
next(sq)
yield next(sq)
except StopIteration:
return
@silence_excs(StopIteration)
def count(sq: IteratorOrIterable, start: tp.Optional[int] = None, step: int = 1) -> tp.Iterator[int]:
"""
Return a sequence of integers, for each entry in the sequence with provided step.
......
......@@ -138,7 +138,6 @@ class TestMetric(unittest.TestCase):
self.assertTrue(inspect.isgeneratorfunction(generator))
self.assertGreaterEqual(next(iter(my_metric.to_metric_data().values)).value, 1)
def test_quantile_context_manager(self):
metric = getMetric('test_metric', 'summary', quantiles=[0.5])
with metric.measure():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment