| 56 | |
| 57 | def test_progressbar_length_hint(runner, monkeypatch): |
| 58 | class Hinted: |
| 59 | def __init__(self, n): |
| 60 | self.items = list(range(n)) |
| 61 | |
| 62 | def __length_hint__(self): |
| 63 | return len(self.items) |
| 64 | |
| 65 | def __iter__(self): |
| 66 | return self |
| 67 | |
| 68 | def __next__(self): |
| 69 | if self.items: |
| 70 | return self.items.pop() |
| 71 | else: |
| 72 | raise StopIteration |
| 73 | |
| 74 | next = __next__ |
| 75 | |
| 76 | @click.command() |
| 77 | def cli(): |