def METHOD_NAME(monkeypatch, tmp_path):
    """Test that the error emitted when a bad backend name is used."""
    match = "Allowed values are 'pyvistaqt' and 'notebook'"
    with pytest.raises(ValueError, match=match):
        set_3d_backend("invalid")
    # gh-9607
    def fail(x):
        raise ModuleNotFoundError(x)
    monkeypatch.setattr("mne.viz.backends.renderer._reload_backend", fail)
    monkeypatch.setattr("mne.viz.backends.renderer.MNE_3D_BACKEND", None)
    match = "Could not load any valid 3D.*\npyvistaqt: .*"
    assert get_3d_backend() is None
    with pytest.raises(RuntimeError, match=match):
        _get_renderer()