def METHOD_NAME(sim_freqs, gains, tmp_path):
    cal_file = str(tmp_path / "bad_kwarg.calfits")
    with pytest.raises(TypeError) as err:
        cli_utils.write_calfits(gains, cal_file, sim=sim_freqs)
    assert err.value.args[0] == "sim must be a Simulator or UVData object."