7070)
7171def test_egi_mff_pause (fname , skip_times , event_times ):
7272 """Test EGI MFF with pauses."""
73+ pytest .importorskip ("defusedxml" )
7374 if fname == egi_pause_w1337_fname :
7475 # too slow to _test_raw_reader
7576 raw = read_raw_egi (fname ).load_data ()
@@ -129,6 +130,7 @@ def test_egi_mff_pause(fname, skip_times, event_times):
129130)
130131def test_egi_mff_pause_chunks (fname , tmp_path ):
131132 """Test that on-demand of all short segments works (via I/O)."""
133+ pytest .importorskip ("defusedxml" )
132134 fname_temp = tmp_path / "test_raw.fif"
133135 raw_data = read_raw_egi (fname , preload = True ).get_data ()
134136 raw = read_raw_egi (fname )
@@ -142,6 +144,7 @@ def test_egi_mff_pause_chunks(fname, tmp_path):
142144@requires_testing_data
143145def test_io_egi_mff ():
144146 """Test importing EGI MFF simple binary files."""
147+ pytest .importorskip ("defusedxml" )
145148 # want vars for n chans
146149 n_ref = 1
147150 n_eeg = 128
@@ -258,6 +261,7 @@ def test_io_egi():
258261@requires_testing_data
259262def test_io_egi_pns_mff (tmp_path ):
260263 """Test importing EGI MFF with PNS data."""
264+ pytest .importorskip ("defusedxml" )
261265 raw = read_raw_egi (egi_mff_pns_fname , include = None , preload = True , verbose = "error" )
262266 assert "RawMff" in repr (raw )
263267 pns_chans = pick_types (raw .info , ecg = True , bio = True , emg = True )
@@ -314,6 +318,7 @@ def test_io_egi_pns_mff(tmp_path):
314318@pytest .mark .parametrize ("preload" , (True , False ))
315319def test_io_egi_pns_mff_bug (preload ):
316320 """Test importing EGI MFF with PNS data (BUG)."""
321+ pytest .importorskip ("defusedxml" )
317322 egi_fname_mff = testing_path / "EGI" / "test_egi_pns_bug.mff"
318323 with pytest .warns (RuntimeWarning , match = "EGI PSG sample bug" ):
319324 raw = read_raw_egi (
@@ -356,6 +361,7 @@ def test_io_egi_pns_mff_bug(preload):
356361@requires_testing_data
357362def test_io_egi_crop_no_preload ():
358363 """Test crop non-preloaded EGI MFF data (BUG)."""
364+ pytest .importorskip ("defusedxml" )
359365 raw = read_raw_egi (egi_mff_fname , preload = False )
360366 raw .crop (17.5 , 20.5 )
361367 raw .load_data ()
@@ -383,6 +389,8 @@ def test_io_egi_crop_no_preload():
383389def test_io_egi_evokeds_mff (idx , cond , tmax , signals , bads ):
384390 """Test reading evoked MFF file."""
385391 pytest .importorskip ("mffpy" , "0.5.7" )
392+
393+ pytest .importorskip ("defusedxml" )
386394 # expected n channels
387395 n_eeg = 256
388396 n_ref = 1
@@ -468,6 +476,7 @@ def test_read_evokeds_mff_bad_input():
468476@requires_testing_data
469477def test_egi_coord_frame ():
470478 """Test that EGI coordinate frame is changed to head."""
479+ pytest .importorskip ("defusedxml" )
471480 info = read_raw_egi (egi_mff_fname ).info
472481 want_idents = (
473482 FIFF .FIFFV_POINT_LPA ,
@@ -505,6 +514,7 @@ def test_egi_coord_frame():
505514)
506515def test_meas_date (fname , timestamp , utc_offset ):
507516 """Test meas date conversion."""
517+ pytest .importorskip ("defusedxml" )
508518 raw = read_raw_egi (fname , verbose = "warning" )
509519 dt = datetime .strptime (timestamp , "%Y-%m-%dT%H:%M:%S.%f%z" )
510520 measdate = dt .astimezone (timezone .utc )
@@ -526,6 +536,7 @@ def test_meas_date(fname, timestamp, utc_offset):
526536)
527537def test_set_standard_montage_mff (fname , standard_montage ):
528538 """Test setting a standard montage."""
539+ pytest .importorskip ("defusedxml" )
529540 raw = read_raw_egi (fname , verbose = "warning" )
530541 n_eeg = int (standard_montage .split ("-" )[- 1 ])
531542 n_dig = n_eeg + 3
0 commit comments