@@ -470,7 +470,7 @@ def test_select_reader(self):
470470
471471 def test_auto_detect_and_override (self ):
472472 tab_as_xlsx = FileFormat .locate ("actually-a-tab-file.xlsx" ,
473- path . split (__file__ )[ 0 ])
473+ [ dirname (__file__ )])
474474 iris = FileFormat .locate ("iris" , dataset_dirs )
475475
476476 reader_combo = self .widget .reader_combo
@@ -536,7 +536,7 @@ def open_file(_a, _b, _c, filters, _e):
536536
537537 # Now load a real Excel file: this is a known excention so the combo
538538 # should return to auto-detect
539- filename = FileFormat .locate ("an_excel_file.xlsx" , dataset_dirs )
539+ filename = FileFormat .locate ("an_excel_file.xlsx" , [ dirname ( __file__ )] )
540540 self .widget .browse_file ()
541541 self .assertEqual (self .widget .reader_combo .currentText (),
542542 "Determine type from the file extension" )
@@ -551,7 +551,7 @@ def open_file(_a, _b, _c, filters, _e):
551551 assert self .get_output (self .widget .Outputs .data ) is not None
552552
553553 # Files with unknown extensions require manual selection
554- filename = FileFormat .locate ("an_excel_file.foo" , dataset_dirs )
554+ filename = FileFormat .locate ("an_excel_file.foo" , [ dirname ( __file__ )] )
555555 self .widget .browse_file ()
556556 self .assertTrue (self .widget .Error .select_file_type .is_shown ())
557557 self .assertIsNone (self .get_output (self .widget .Outputs .data ))
@@ -562,7 +562,7 @@ def open_file(_a, _b, _c, filters, _e):
562562 self .assertIsNotNone (self .get_output (self .widget .Outputs .data ))
563563
564564 # Consecutive loading of files with the same extension keeps selection
565- filename = FileFormat .locate ("an_excel_file-too.foo" , dataset_dirs )
565+ filename = FileFormat .locate ("an_excel_file-too.foo" , [ dirname ( __file__ )] )
566566 self .widget .browse_file ()
567567 self .assertFalse (self .widget .Error .unknown_select .is_shown ())
568568 self .assertFalse (self .widget .Error .select_file_type .is_shown ())
0 commit comments