コード例 #1
0
def test_parse_python_requires_unexpected_dot_star(monkeypatch, capsys, op):
    monkeypatch.setattr(cpv, 'CURRENT_PYTHON_3_VERSION', 7)
    assert cpv.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_parse_python_requires_approximately_not_enough_dots(capsys):
    assert cpv.parse_python_requires('~= 2') is None
    assert (
        'Bad python_requires specifier: ~= 2'
        ' (~= requires a version with at least one dot)'
        in capsys.readouterr().err
    )
コード例 #3
0
def test_parse_python_requires_syntax_errors(capsys, specifier):
    assert cpv.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 cpv.parse_python_requires(constraint) == result
コード例 #5
0
def test_parse_python_exclusive_ordering(constraint, result):
    assert cpv.parse_python_requires(constraint) == result
コード例 #6
0
def test_parse_python_requires_multiple_greater_than(monkeypatch):
    monkeypatch.setattr(cpv, 'CURRENT_PYTHON_3_VERSION', 7)
    assert cpv.parse_python_requires('>= 2.7, >= 3.6') == ['3.6', '3.7']
コード例 #7
0
def test_parse_python_requires_greater_than_with_exceptions(
    monkeypatch, constraint, result
):
    monkeypatch.setattr(cpv, 'CURRENT_PYTHON_3_VERSION', 3)
    assert cpv.parse_python_requires(constraint) == result
コード例 #8
0
def test_parse_python_requires_matching_version(constraint, result):
    assert cpv.parse_python_requires(constraint) == result
コード例 #9
0
def test_parse_python_requires_approximately(constraint, result):
    assert cpv.parse_python_requires(constraint) == result