示例#1
0
def test_parse_python_requires_unexpected_dot_star(fix_max_python_3_version,
                                                   capsys, op):
    fix_max_python_3_version(7)
    assert parse_python_requires(f'{op} 3.6.*') is None
    assert (
        f'Bad python_requires specifier: {op} 3.6.* ({op} does not allow a .*)'
        in capsys.readouterr().err)
示例#2
0
def test_compute_python_requires(versions, expected, fix_max_python_3_version):
    fix_max_python_3_version(7)
    result = compute_python_requires(v(versions))
    assert result == expected
    assert parse_python_requires(result) == v(versions)
示例#3
0
def test_parse_python_requires_syntax_errors(capsys, specifier):
    assert parse_python_requires(specifier) is None
    assert (f'Bad python_requires specifier: {specifier}'
            in capsys.readouterr().err)
示例#4
0
def test_parse_python_requires_arbitrary_version(constraint, result):
    assert parse_python_requires(constraint) == v(result)
示例#5
0
def test_parse_python_requires_multiple_greater_than(fix_max_python_3_version):
    fix_max_python_3_version(7)
    assert parse_python_requires('>= 2.7, >= 3.6') == v(['3.6', '3.7'])
示例#6
0
def test_parse_python_requires_exclusive_ordering(constraint, result):
    assert parse_python_requires(constraint) == v(result)
示例#7
0
def test_parse_python_requires_greater_than_with_exceptions(
        fix_max_python_3_version, constraint, result):
    fix_max_python_3_version(3)
    assert parse_python_requires(constraint) == v(result)
示例#8
0
def test_parse_python_requires_greater_than(fix_max_python_3_version):
    fix_max_python_3_version(8)
    assert parse_python_requires('>= 3.6') == v(['3.6', '3.7', '3.8'])
示例#9
0
def test_parse_python_requires_matching_version(constraint, result):
    assert parse_python_requires(constraint) == v(result)
示例#10
0
def test_parse_python_requires_approximately_not_enough_dots(capsys):
    assert parse_python_requires('~= 2') is None
    assert ('Bad python_requires specifier: ~= 2'
            ' (~= requires a version with at least one dot)'
            in capsys.readouterr().err)
示例#11
0
def test_parse_python_requires_approximately(constraint, result):
    assert parse_python_requires(constraint) == v(result)