def renderer_interactive(backend_name_interactive): """Yield the 3D backends.""" from mne.viz.backends.renderer import _use_test_3d_backend _check_skip_backend(backend_name_interactive) with _use_test_3d_backend(backend_name_interactive, interactive=True): from mne.viz.backends import renderer yield renderer renderer.backend._close_all()
def renderer(backend_name, garbage_collect): """Yield the 3D backends.""" from mne.viz.backends.renderer import _use_test_3d_backend _check_skip_backend(backend_name) with _use_test_3d_backend(backend_name): from mne.viz.backends import renderer yield renderer renderer.backend._close_all()
def backends_3d(backend_name): from mne.viz.backends.renderer import _use_test_3d_backend from mne.viz.backends.tests._utils import has_not_mayavi if backend_name == 'mayavi': if has_not_mayavi(): pytest.skip("Test skipped, requires mayavi.") with _use_test_3d_backend(backend_name): yield
def _use_backend(backend_name, interactive): from mne.viz.backends.renderer import _use_test_3d_backend _check_skip_backend(backend_name) with _use_test_3d_backend(backend_name, interactive=interactive): from mne.viz.backends import renderer try: yield renderer finally: renderer.backend._close_all()
def renderer_notebook(): """Verify that pytest_notebook is installed.""" from mne.viz.backends.renderer import _use_test_3d_backend try: with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) from pytest_notebook import execution except ImportError: pytest.skip("Test skipped, requires pytest-notebook") with _use_test_3d_backend('notebook'): yield execution
def backends_3d(backend_name): """Yield the 3D backends.""" from mne.viz.backends.renderer import _use_test_3d_backend from mne.viz.backends.tests._utils import has_mayavi, has_pyvista if backend_name == 'mayavi': if not has_mayavi(): pytest.skip("Test skipped, requires mayavi.") elif backend_name == 'pyvista': if not has_pyvista(): pytest.skip("Test skipped, requires pyvista.") with _use_test_3d_backend(backend_name): yield
def renderer_notebook(): """Verify that pytest_notebook is installed.""" from mne.viz.backends import renderer with renderer._use_test_3d_backend('notebook'): yield renderer