summaryrefslogtreecommitdiffstats
path: root/tests/tests_version.py
blob: 495c797f27a0f2dad1a4057375a4a905f459a81a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""Test `tqdm.__version__`."""
import re
from ast import literal_eval


def test_version():
    """Test version string"""
    from tqdm import __version__
    version_parts = re.split('[.-]', __version__)
    if __version__ != "UNKNOWN":
        assert 3 <= len(version_parts), "must have at least Major.minor.patch"
        assert all(
            isinstance(literal_eval(i), int) for i in version_parts[:3]
        ), "Version Major.minor.patch must be 3 integers"