@@ -470,7 +470,7 @@ def test_select_reader(self):
470470
471471def test_auto_detect_and_override (self ):
472472tab_as_xlsx = FileFormat .locate ("actually-a-tab-file.xlsx" ,
473- path . split (__file__ )[ 0 ])
473+ [ dirname (__file__ )])
474474iris = FileFormat .locate ("iris" ,dataset_dirs )
475475
476476reader_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__ )] )
540540self .widget .browse_file ()
541541self .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):
551551assert 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__ )] )
555555self .widget .browse_file ()
556556self .assertTrue (self .widget .Error .select_file_type .is_shown ())
557557self .assertIsNone (self .get_output (self .widget .Outputs .data ))
@@ -562,7 +562,7 @@ def open_file(_a, _b, _c, filters, _e):
562562self .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__ )] )
566566self .widget .browse_file ()
567567self .assertFalse (self .widget .Error .unknown_select .is_shown ())
568568self .assertFalse (self .widget .Error .select_file_type .is_shown ())