3030@testing .requires_testing_data
3131def test_get_brainvision_encoding ():
3232 """Test getting the file-encoding from a BrainVision header."""
33- data_path = op . join ( base_path , "brainvision" , "tests" , "data" )
34- raw_fname = op . join ( data_path , "test.vhdr" )
33+ data_path = base_path / "brainvision" / "tests" / "data"
34+ raw_fname = data_path / "test.vhdr"
3535
3636 with pytest .raises (UnicodeDecodeError ):
3737 with open (raw_fname , encoding = "ascii" ) as f :
@@ -44,11 +44,11 @@ def test_get_brainvision_encoding():
4444
4545def test_get_brainvision_paths (tmp_path ):
4646 """Test getting the file links from a BrainVision header."""
47- data_path = op . join ( base_path , "brainvision" , "tests" , "data" )
48- raw_fname = op . join ( data_path , "test.vhdr" )
47+ data_path = base_path / "brainvision" / "tests" / "data"
48+ raw_fname = data_path / "test.vhdr"
4949
5050 with pytest .raises (ValueError ):
51- _get_brainvision_paths (op . join ( data_path , "test.eeg" ) )
51+ _get_brainvision_paths (data_path / "test.eeg" )
5252
5353 # Write some temporary test files
5454 with open (tmp_path / "test1.vhdr" , "w" ) as f :
@@ -76,10 +76,10 @@ def test_get_brainvision_paths(tmp_path):
7676)
7777def test_copyfile_brainvision (tmp_path ):
7878 """Test the copying of BrainVision vhdr, vmrk and eeg files."""
79- bids_root = str ( tmp_path )
80- data_path = op . join ( base_path , "brainvision" , "tests" , "data" )
81- raw_fname = op . join ( data_path , "test.vhdr" )
82- new_name = op . join ( bids_root , "tested_conversion.vhdr" )
79+ bids_root = tmp_path
80+ data_path = base_path / "brainvision" / "tests" / "data"
81+ raw_fname = data_path / "test.vhdr"
82+ new_name = bids_root / "tested_conversion.vhdr"
8383
8484 # IO error testing
8585 with pytest .raises (ValueError , match = "Need to move data with same" ):
@@ -112,18 +112,18 @@ def test_copyfile_edf(tmp_path):
112112 """Test the anonymization of EDF/BDF files."""
113113 bids_root = tmp_path / "bids1"
114114 bids_root .mkdir ()
115- data_path = op . join ( base_path , "edf" , "tests" , "data" )
115+ data_path = base_path / "edf" / "tests" / "data"
116116
117117 # Test regular copying
118118 for ext in [".edf" , ".bdf" ]:
119- raw_fname = op . join ( data_path , "test" + ext )
120- new_name = op . join ( bids_root , "test_copy" + ext )
119+ raw_fname = data_path / f "test{ ext } "
120+ new_name = bids_root / f "test_copy{ ext } "
121121 copyfile_edf (raw_fname , new_name )
122122
123123 # IO error testing
124124 with pytest .raises (ValueError , match = "Need to move data with same" ):
125- raw_fname = op . join ( data_path , "test.edf" )
126- new_name = op . join ( bids_root , "test_copy.bdf" )
125+ raw_fname = data_path / "test.edf"
126+ new_name = bids_root / "test_copy.bdf"
127127 copyfile_edf (raw_fname , new_name )
128128
129129 # Add some subject info to an EDF to test anonymization
@@ -184,7 +184,7 @@ def test_copyfile_edfbdf_uppercase(tmp_path):
184184 """Test the copying of EDF/BDF files with upper-case extension."""
185185 bids_root = tmp_path / "bids1"
186186 bids_root .mkdir ()
187- data_path = op . join ( base_path , "edf" , "tests" , "data" )
187+ data_path = base_path / "edf" / "tests" / "data"
188188
189189 # Test regular copying
190190 for ext in [".edf" , ".bdf" ]:
@@ -226,7 +226,7 @@ def test_copyfile_eeglab(tmp_path, fname):
226226def test_copyfile_kit (tmp_path ):
227227 """Test copying and renaming KIT files to a new location."""
228228 output_path = str (tmp_path )
229- data_path = op . join ( base_path , "kit" , "tests" , "data" )
229+ data_path = base_path / "kit" / "tests" / "data"
230230 raw_fname = op .join (data_path , "test.sqd" )
231231 hpi_fname = op .join (data_path , "test_mrk.sqd" )
232232 electrode_fname = op .join (data_path , "test.elp" )
0 commit comments