From 899f9306db49bd9630e297ccfcaa57e42fe5667e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 4 Feb 2025 16:26:56 -0500 Subject: [PATCH] FIX: Conda --- mne/conftest.py | 13 ++++++++++--- mne/viz/tests/test_3d.py | 8 -------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/mne/conftest.py b/mne/conftest.py index 8451c9e776b..2d57f2fb186 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -6,6 +6,7 @@ import inspect import os import os.path as op +import platform import re import shutil import sys @@ -287,9 +288,10 @@ def __init__(self, exception_handler=None, signals=None): @pytest.fixture(scope="session") def azure_windows(): """Determine if running on Azure Windows.""" - return os.getenv( - "AZURE_CI_WINDOWS", "false" - ).lower() == "true" and sys.platform.startswith("win") + return ( + os.getenv("AZURE_CI_WINDOWS", "false").lower() == "true" + and platform.system() == "Windows" + ) @pytest.fixture(scope="function") @@ -612,6 +614,11 @@ def renderer_pyvistaqt(request, options_3d, garbage_collect): @pytest.fixture(params=[pytest.param("notebook", marks=pytest.mark.pvtest)]) def renderer_notebook(request, options_3d): """Yield the 3D notebook renderer.""" + if ( + os.getenv("MNE_CI_KIND", "") in ("conda", "mamba") + and platform.system() == "Linux" + ): + pytest.skip("Skipping notebook tests on conda Linux CI") with _use_backend(request.param, interactive=False) as renderer: yield renderer diff --git a/mne/viz/tests/test_3d.py b/mne/viz/tests/test_3d.py index 7af43d8a5f8..e3e4a2143d2 100644 --- a/mne/viz/tests/test_3d.py +++ b/mne/viz/tests/test_3d.py @@ -2,8 +2,6 @@ # License: BSD-3-Clause # Copyright the MNE-Python contributors. -import os -import platform from contextlib import nullcontext from pathlib import Path @@ -227,14 +225,8 @@ def test_plot_evoked_field(renderer): assert isinstance(fig, Figure3D) -bad_ci = ( - os.getenv("MNE_CI_KIND", "") in ("conda", "mamba") and platform.system() == "Linux" -) - - @testing.requires_testing_data @pytest.mark.slowtest -@pytest.mark.skipif(bad_ci, reason="Segfaults on Linux conda CI") def test_plot_evoked_field_notebook(renderer_notebook, nbexec): """Test plotting the evoked field inside a notebook.""" import pytest