@@ -544,7 +544,7 @@ def test_parse_errors(self):
544544 "[Foo]\n wrong-indent\n " )
545545 self .assertEqual (e .args , ('<???>' ,))
546546 # read_file on a real file
547- tricky = support .findfile ("cfgparser.3" )
547+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
548548 if self .delimiters [0 ] == '=' :
549549 error = configparser .ParsingError
550550 expected = (tricky ,)
@@ -718,7 +718,7 @@ class mystr(str):
718718 def test_read_returns_file_list (self ):
719719 if self .delimiters [0 ] != '=' :
720720 self .skipTest ('incompatible format' )
721- file1 = support .findfile ("cfgparser.1" )
721+ file1 = support .findfile ("cfgparser.1" , subdir = "configdata" )
722722 # check when we pass a mix of readable and non-readable files:
723723 cf = self .newconfig ()
724724 parsed_files = cf .read ([file1 , "nonexistent-file" ], encoding = "utf-8" )
@@ -751,7 +751,7 @@ def test_read_returns_file_list(self):
751751 def test_read_returns_file_list_with_bytestring_path (self ):
752752 if self .delimiters [0 ] != '=' :
753753 self .skipTest ('incompatible format' )
754- file1_bytestring = support .findfile ("cfgparser.1" ).encode ()
754+ file1_bytestring = support .findfile ("cfgparser.1" , subdir = "configdata" ).encode ()
755755 # check when passing an existing bytestring path
756756 cf = self .newconfig ()
757757 parsed_files = cf .read (file1_bytestring , encoding = "utf-8" )
@@ -1161,7 +1161,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass, unittest.TestCase):
11611161 empty_lines_in_values = False
11621162
11631163 def test_reading (self ):
1164- smbconf = support .findfile ("cfgparser.2" )
1164+ smbconf = support .findfile ("cfgparser.2" , subdir = "configdata" )
11651165 # check when we pass a mix of readable and non-readable files:
11661166 cf = self .newconfig ()
11671167 parsed_files = cf .read ([smbconf , "nonexistent-file" ], encoding = 'utf-8' )
@@ -1356,7 +1356,7 @@ class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
13561356 allow_no_value = True
13571357
13581358 def test_cfgparser_dot_3 (self ):
1359- tricky = support .findfile ("cfgparser.3" )
1359+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
13601360 cf = self .newconfig ()
13611361 self .assertEqual (len (cf .read (tricky , encoding = 'utf-8' )), 1 )
13621362 self .assertEqual (cf .sections (), ['strange' ,
@@ -1388,7 +1388,7 @@ def test_cfgparser_dot_3(self):
13881388 self .assertEqual (cf .get ('more interpolation' , 'lets' ), 'go shopping' )
13891389
13901390 def test_unicode_failure (self ):
1391- tricky = support .findfile ("cfgparser.3" )
1391+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
13921392 cf = self .newconfig ()
13931393 with self .assertRaises (UnicodeDecodeError ):
13941394 cf .read (tricky , encoding = 'ascii' )
@@ -1489,7 +1489,7 @@ def fromstring(self, string, defaults=None):
14891489
14901490class FakeFile :
14911491 def __init__ (self ):
1492- file_path = support .findfile ("cfgparser.1" )
1492+ file_path = support .findfile ("cfgparser.1" , subdir = "configdata" )
14931493 with open (file_path , encoding = "utf-8" ) as f :
14941494 self .lines = f .readlines ()
14951495 self .lines .reverse ()
@@ -1510,7 +1510,7 @@ def readline_generator(f):
15101510
15111511class ReadFileTestCase (unittest .TestCase ):
15121512 def test_file (self ):
1513- file_paths = [support .findfile ("cfgparser.1" )]
1513+ file_paths = [support .findfile ("cfgparser.1" , subdir = "configdata" )]
15141514 try :
15151515 file_paths .append (file_paths [0 ].encode ('utf8' ))
15161516 except UnicodeEncodeError :
0 commit comments