def METHOD_NAME(self, temp_env):
    # Other tests test flag_handlers set as bound methods and functions.
    # This tests an unbound method in python2 (no change in python3).
    s = spack.spec.Spec("mpileaks cppflags=-g").concretized()
    s.package.flag_handler = s.package.__class__.inject_flags
    spack.build_environment.setup_package(s.package, False)
    assert os.environ["SPACK_CPPFLAGS"] == "-g"
    assert "CPPFLAGS" not in os.environ