44
55import datetime as dt
66import os
7- import shutil
87
98import numpy as np
109import pytest
2221 source_detector_distances ,
2322)
2423from mne .transforms import _get_trans , apply_trans
24+ from mne .utils import copytree_rw
2525
2626testing_path = data_path (download = False )
2727fname_nirx_15_0 = testing_path / "NIRx" / "nirscout" / "nirx_15_0_recording"
@@ -246,7 +246,7 @@ def test_nirx_missing_warn():
246246@requires_testing_data
247247def test_nirx_missing_evt (tmp_path ):
248248 """Test reading NIRX files when missing data."""
249- shutil . copytree (fname_nirx_15_2_short , str (tmp_path ) + "/data/" )
249+ copytree_rw (fname_nirx_15_2_short , str (tmp_path ) + "/data/" )
250250 os .rename (
251251 tmp_path / "data" / "NIRS-2019-08-23_001.evt" ,
252252 tmp_path / "data" / "NIRS-2019-08-23_001.xxx" ,
@@ -259,7 +259,7 @@ def test_nirx_missing_evt(tmp_path):
259259@requires_testing_data
260260def test_nirx_dat_warn (tmp_path ):
261261 """Test reading NIRX files when missing data."""
262- shutil . copytree (fname_nirx_15_2_short , str (tmp_path ) + "/data/" )
262+ copytree_rw (fname_nirx_15_2_short , str (tmp_path ) + "/data/" )
263263 os .rename (
264264 tmp_path / "data" / "NIRS-2019-08-23_001.dat" ,
265265 tmp_path / "data" / "NIRS-2019-08-23_001.tmp" ,
@@ -461,7 +461,7 @@ def test_nirx_15_3_short():
461461def test_locale_encoding (tmp_path ):
462462 """Test NIRx encoding."""
463463 fname = tmp_path / "latin"
464- shutil . copytree (fname_nirx_15_2 , fname )
464+ copytree_rw (fname_nirx_15_2 , fname )
465465 hdr_fname = fname / "NIRS-2019-10-02_003.hdr"
466466 hdr = list ()
467467 with open (hdr_fname , "rb" ) as fid :
0 commit comments