Skip to content

[tests] Python-only tests hidden behind MATLAB skips never run in CI #432

Closed

Description

@suraj-ranganath

🤖 Some pure-Python tests only run when MATLAB is available.

Some tests that need no MATLAB sit inside classes or modules that skip entirely when EEGPREP_SKIP_MATLAB=1. That is the setting on every CI runner without a MATLAB license. These tests never run in normal CI.

  1. tests/test_pop_reref.py::TestPopReref. The class has @unittest.skipIf(os.getenv('EEGPREP_SKIP_MATLAB') == '1', ...). Besides its MATLAB parity tests it holds 13 Python-only tests:
    • test_explicit_single_reference_removes_ref_by_default, test_explicit_reference_label_keepref, test_explicit_reference_without_chanlocs_still_rereferences
    • test_refica_remove_and_off_modes, test_refica_clears_when_ica_channel_is_excluded, test_interpchan_clears_ica_when_channel_set_changes, test_error_icachansind_mismatch
    • test_history_command_formats_label_reference_like_eeglab, test_history_command_formats_numeric_channels_as_matlab_indices, test_history_command_formats_refloc_struct_like_eeglab
    • test_multiple_dataset_gui_path_prompts_once_like_eeglab, test_gui_huber_path_preserves_other_eeglab_gui_options, test_gui_numeric_reference_text_is_zero_based_like_python_api
  2. tests/test_pop_loadset_h5.py. The module raises unittest.SkipTest at import when MATLAB is unavailable, and the file is listed in MATLAB_FILE_SUFFIXES in tests/conftest.py. That also skips the pure-Python TestPopLoadsetH5RealData tests: test_compare_continuous_pop_loadset, test_compare_epochs_pop_loadset and test_direct_call_returns_zero_based_urevent_and_urchan. These compare HDF5 against v7 on real files and check 0-based urevent/urchan. Run with EEGPREP_SKIP_MATLAB=0 they pass (3 passed).

Fix: move the Python-only tests out of the MATLAB-gated class/module, or gate only the parity tests (for example a per-test skipIf, or a matlab marker on just the parity class). Then update the conftest maps. This predates #429, which only pointed it out.

Activity

  1. added
    bug
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions