コード例 #1
0
def test_test_no_underscores_all_dashes_error(in_tmpdir):
    tmpfile = in_tmpdir.join('tmp')
    tmpfile.write('foo_bar==1')
    with pytest.raises(AssertionError) as excinfo:
        main.test_no_underscores_all_dashes(
            requirements_files=(tmpfile.strpath, ), )
    assert excinfo.value.args == (
        'Use dashes for package names {}: foo_bar==1'.format(
            tmpfile.strpath), )
コード例 #2
0
def test_test_no_underscores_all_dashes_ignores_env_markers(in_tmpdir):
    tmpfile = in_tmpdir.join('tmp')
    tmpfile.write('foo==1;python_version>2.5 and python_version<=2.7')
    # Should not raise
    main.test_no_underscores_all_dashes(requirements_files=(tmpfile.strpath, ))
コード例 #3
0
def test_test_no_underscores_all_dashes_ok(in_tmpdir):
    tmpfile = in_tmpdir.join('tmp')
    tmpfile.write('foo==1')
    # Should not raise
    main.test_no_underscores_all_dashes(requirements_files=(tmpfile.strpath, ))
コード例 #4
0
def test_test_no_underscores_passes_reqs_dev_doesnt_exist(in_tmpdir):
    """If requirements.txt exists (but not -dev.txt) we shouldn't raise."""
    in_tmpdir.join('requirements.txt').write('foo==1')
    # Should not raise
    main.test_no_underscores_all_dashes()