def METHOD_NAME(self):
    case_mock = mock.MagicMock()
    machine_mock = mock.MagicMock()
    machine_mock.get_machine_name.return_value = "test"
    # create context stack to cleanup after test
    with contextlib.ExitStack() as stack:
        root_path = stack.enter_context(create_machines_dir())
        case_path = stack.enter_context(tempfile.TemporaryDirectory())
        extra_path = stack.enter_context(tempfile.TemporaryDirectory())
        extra_cmake_path = Path(extra_path, "cmake_macros")
        extra_cmake_path.mkdir()
        extra_macros_path = extra_cmake_path / "extra.cmake"
        extra_macros_path.touch()
        cmake_macros_path = os.path.join(root_path, "machines", "cmake_macros")
        case_mock.get_value.side_effect = [cmake_macros_path, extra_path]
        machines_path = os.path.join(root_path, "machines")
        type(machine_mock).machines_dir = mock.PropertyMock(
            return_value=machines_path
        )
        # do not generate env_mach_specific.xml
        Path(os.path.join(case_path, "env_mach_specific.xml")).touch()
        # make sure we're calling everything from within the case root
        stack.enter_context(chdir(case_path))
        case_setup._create_macros(
            case_mock,
            machine_mock,
            case_path,
            "gnu-test",
            "openmpi",
            False,
            "mct",
            "LINUX",
        )
        case_mock.get_value.assert_any_call("EXTRA_MACHDIR")
        assert os.path.exists(
            os.path.join(case_path, "cmake_macros", "extra.cmake")
        )