def _check_pytest_version(version, max_version):
    """ Check if version is less or equal to the max_version.

    Args:
        version(str): product version
        max_version(str):  max product version

    Returns:
        bool: True/False

    """
    version_list = version.split('.')
    max_version_list = max_version.split('.')
    i = 0
    while i <= len(version_list):
        if len(version_list) == i:
            return True
        if len(max_version_list) == i:
            return False
        if int(max_version_list[i]) > int(version_list[i]):
            return True
        if int(max_version_list[i]) == int(version_list[i]):
            i += 1
            continue
        if int(max_version_list[i]) < int(version_list[i]):
            return False
    return False