tqdm/tests/tests_version.py

17 lines
563 B
Python
Raw Normal View History

"""Test `tqdm.__version__`."""
from ast import literal_eval
import re
2020-10-24 21:35:32 +00:00
2020-10-24 22:43:59 +00:00
from .tests_tqdm import pretest_posttest # NOQA, pylint: disable=unused-import
2020-10-24 17:42:50 +00:00
2020-10-24 18:36:45 +00:00
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")