2020-11-16 20:05:11 +00:00
|
|
|
"""Test `tqdm.__version__`."""
|
2016-04-11 19:23:22 +00:00
|
|
|
import re
|
2021-01-09 17:00:18 +00:00
|
|
|
from ast import literal_eval
|
2020-10-24 21:35:32 +00:00
|
|
|
|
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__)
|
2020-11-16 20:05:11 +00:00
|
|
|
if __version__ != "UNKNOWN":
|
|
|
|
assert 3 <= len(version_parts), "must have at least Major.minor.patch"
|
2021-01-09 16:50:30 +00:00
|
|
|
assert all(
|
|
|
|
isinstance(literal_eval(i), int) for i in version_parts[:3]
|
|
|
|
), "Version Major.minor.patch must be 3 integers"
|