def METHOD_NAME(self, temp_env):
    s = spack.spec.Spec("mpileaks cppflags=-g").concretized()
    s.package.flag_handler = env_flags
    spack.build_environment.setup_package(s.package, False)
    assert os.environ["CPPFLAGS"] == "-g"
    assert "SPACK_CPPFLAGS" not in os.environ