@@ -3368,6 +3368,22 @@ def test_sidecar_encoding(_bids_validate, tmp_path):
33683368 assert_array_equal (raw .annotations .description , raw_read .annotations .description )
33693369
33703370
3371+ @testing .requires_testing_data
3372+ def test_emg_errors_and_warnings (tmp_path ):
3373+ """Test EMG-specific error/warning raising."""
3374+ bids_root = tmp_path / "EDF"
3375+ raw_fname = data_path / "EDF" / "test_generator_2.edf"
3376+ bids_path = _bids_path .copy ().update (root = bids_root , datatype = "emg" )
3377+ raw = _read_raw_edf (raw_fname )
3378+ raw .set_channel_types ({ch : "emg" for ch in raw .ch_names }) # HACK eeg → emg
3379+ raw = raw .pick (["emg" ]) # drop misc
3380+ good_kwargs = dict (raw = raw , bids_path = bids_path , verbose = False )
3381+ with pytest .raises (ValueError , match = "`emg_placement` must be one of" ):
3382+ write_raw_bids (** good_kwargs , emg_placement = "Foo" )
3383+ with pytest .warns (RuntimeWarning , match = "add `coordsystem.json` file manually" ):
3384+ write_raw_bids (** good_kwargs , emg_placement = "Other" )
3385+
3386+
33713387@pytest .mark .parametrize ("dir_name, fmt, fname, reader" , test_convertemg_data )
33723388@pytest .mark .filterwarnings (
33733389 warning_str ["edfblocks" ],
0 commit comments