Example #1
0
def test_install_prefix_collision_fails(config, mock_fetch, mock_packages, tmpdir):
    """
    Test that different specs with coinciding install prefixes will fail
    to install.
    """
    projections = {'all': 'all-specs-project-to-this-prefix'}
    store = spack.store.Store(str(tmpdir), projections=projections)
    with spack.store.use_store(store):
        with spack.config.override('config:checksum', False):
            pkg_a = Spec('[email protected]').concretized().package
            pkg_b = Spec('[email protected]').concretized().package
            pkg_a.do_install()

            with pytest.raises(InstallError, match="Install prefix collision"):
                pkg_b.do_install()