@@ -543,7 +543,7 @@ def test_parse_errors(self):
543543 "[Foo]\n wrong-indent\n " )
544544 self .assertEqual (e .args , ('<???>' ,))
545545 # read_file on a real file
546- tricky = support .findfile ("cfgparser.3" )
546+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
547547 if self .delimiters [0 ] == '=' :
548548 error = configparser .ParsingError
549549 expected = (tricky ,)
@@ -717,7 +717,7 @@ class mystr(str):
717717 def test_read_returns_file_list (self ):
718718 if self .delimiters [0 ] != '=' :
719719 self .skipTest ('incompatible format' )
720- file1 = support .findfile ("cfgparser.1" )
720+ file1 = support .findfile ("cfgparser.1" , subdir = "configdata" )
721721 # check when we pass a mix of readable and non-readable files:
722722 cf = self .newconfig ()
723723 parsed_files = cf .read ([file1 , "nonexistent-file" ], encoding = "utf-8" )
@@ -750,7 +750,7 @@ def test_read_returns_file_list(self):
750750 def test_read_returns_file_list_with_bytestring_path (self ):
751751 if self .delimiters [0 ] != '=' :
752752 self .skipTest ('incompatible format' )
753- file1_bytestring = support .findfile ("cfgparser.1" ).encode ()
753+ file1_bytestring = support .findfile ("cfgparser.1" , subdir = "configdata" ).encode ()
754754 # check when passing an existing bytestring path
755755 cf = self .newconfig ()
756756 parsed_files = cf .read (file1_bytestring , encoding = "utf-8" )
@@ -1126,7 +1126,7 @@ class RawConfigParserTestSambaConf(CfgParserTestCaseClass, unittest.TestCase):
11261126 empty_lines_in_values = False
11271127
11281128 def test_reading (self ):
1129- smbconf = support .findfile ("cfgparser.2" )
1129+ smbconf = support .findfile ("cfgparser.2" , subdir = "configdata" )
11301130 # check when we pass a mix of readable and non-readable files:
11311131 cf = self .newconfig ()
11321132 parsed_files = cf .read ([smbconf , "nonexistent-file" ], encoding = 'utf-8' )
@@ -1321,7 +1321,7 @@ class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
13211321 allow_no_value = True
13221322
13231323 def test_cfgparser_dot_3 (self ):
1324- tricky = support .findfile ("cfgparser.3" )
1324+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
13251325 cf = self .newconfig ()
13261326 self .assertEqual (len (cf .read (tricky , encoding = 'utf-8' )), 1 )
13271327 self .assertEqual (cf .sections (), ['strange' ,
@@ -1353,7 +1353,7 @@ def test_cfgparser_dot_3(self):
13531353 self .assertEqual (cf .get ('more interpolation' , 'lets' ), 'go shopping' )
13541354
13551355 def test_unicode_failure (self ):
1356- tricky = support .findfile ("cfgparser.3" )
1356+ tricky = support .findfile ("cfgparser.3" , subdir = "configdata" )
13571357 cf = self .newconfig ()
13581358 with self .assertRaises (UnicodeDecodeError ):
13591359 cf .read (tricky , encoding = 'ascii' )
@@ -1454,7 +1454,7 @@ def fromstring(self, string, defaults=None):
14541454
14551455class FakeFile :
14561456 def __init__ (self ):
1457- file_path = support .findfile ("cfgparser.1" )
1457+ file_path = support .findfile ("cfgparser.1" , subdir = "configdata" )
14581458 with open (file_path , encoding = "utf-8" ) as f :
14591459 self .lines = f .readlines ()
14601460 self .lines .reverse ()
@@ -1475,7 +1475,7 @@ def readline_generator(f):
14751475
14761476class ReadFileTestCase (unittest .TestCase ):
14771477 def test_file (self ):
1478- file_paths = [support .findfile ("cfgparser.1" )]
1478+ file_paths = [support .findfile ("cfgparser.1" , subdir = "configdata" )]
14791479 try :
14801480 file_paths .append (file_paths [0 ].encode ('utf8' ))
14811481 except UnicodeEncodeError :
0 commit comments