Skip to content
Myr

typing_progressbar.py

This file

Path

tests/typing/typing_progressbar.py

24 lines · 559 bytes · Python

Last changed by

Not known.

History of this file

Take it

1from __future__ import annotations23from typing_extensions import assert_type45from click import progressbar6from click._termui_impl import ProgressBar789def test_length_is_int() -> None:10    with progressbar(length=5) as bar:11        assert_type(bar, ProgressBar[int])12        for i in bar:13            assert_type(i, int)141516def it() -> tuple[str, ...]:17    return ("hello", "world")181920def test_generic_on_iterable() -> None:21    with progressbar(it()) as bar:22        assert_type(bar, ProgressBar[str])23        for s in bar:24            assert_type(s, str)