Skip to content

Commit

Permalink
MNT: test coreg UI with notebook 3d backend (mne-tools#10291)
Browse files Browse the repository at this point in the history
* test coreg with notebook

* fix

* again

* edit
  • Loading branch information
GuillaumeFavelier authored Feb 2, 2022
1 parent 258b462 commit 7a8964a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mne/gui/_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _get_default(var, val):
self._renderer.plotter.add_callback(
self._redraw, self._refresh_rate_ms)
self._renderer.plotter.show_axes()
if block:
if block and self._renderer._kind != 'notebook':
_qt_app_exec(self._renderer.figure.store["app"])

def _set_subjects_dir(self, subjects_dir):
Expand Down
14 changes: 14 additions & 0 deletions mne/gui/tests/test_coreg_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,17 @@ def test_coreg_gui_pyvista(tmp_path, renderer_interactive_pyvistaqt):
coreg.close()
# Coregistration instance should survive
assert isinstance(coreg.coreg, Coregistration)


@pytest.mark.slowtest
@testing.requires_testing_data
def test_coreg_gui_notebook(renderer_notebook, nbexec):
"""Test the coregistration UI in a notebook."""
import os
import mne
from mne.datasets import testing
from mne.gui import coregistration
mne.viz.set_3d_backend('notebook') # set the 3d backend
data_path = testing.data_path()
subjects_dir = os.path.join(data_path, 'subjects')
coregistration(subject='sample', subjects_dir=subjects_dir)

0 comments on commit 7a8964a

Please sign in to comment.