File tree 1 file changed +11
-5
lines changed 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -196,17 +196,18 @@ class IdleConfTest(unittest.TestCase):
196
196
197
197
@classmethod
198
198
def setUpClass (cls ):
199
+ cls .config_string = {}
200
+
199
201
conf = config .IdleConf (_utest = True )
200
202
if __name__ != '__main__' :
201
203
idle_dir = os .path .dirname (__file__ )
202
204
else :
203
205
idle_dir = os .path .abspath (sys .path [0 ])
204
206
for ctype in conf .config_types :
205
207
config_path = os .path .join (idle_dir , '../config-%s.def' % ctype )
206
- conf .defaultCfg [ctype ] = config .IdleConfParser (config_path )
207
- conf .userCfg [ctype ] = config .IdleUserConfParser (config_path )
208
- conf .LoadCfgFiles ()
209
- cls .conf = conf
208
+ with open (config_path , 'r' ) as f :
209
+ cls .config_string [ctype ] = f .read ()
210
+
210
211
cls .orig_warn = config ._warn
211
212
config ._warn = Func ()
212
213
@@ -222,7 +223,12 @@ def mock_config(self):
222
223
223
224
Both default and user config used the same config-*.def
224
225
"""
225
- conf = copy .deepcopy (self .conf )
226
+ conf = config .IdleConf (_utest = True )
227
+ for ctype in conf .config_types :
228
+ conf .defaultCfg [ctype ] = config .IdleConfParser ('' )
229
+ conf .defaultCfg [ctype ].read_string (self .config_string [ctype ])
230
+ conf .userCfg [ctype ] = config .IdleUserConfParser ('' )
231
+ conf .userCfg [ctype ].read_string (self .config_string [ctype ])
226
232
227
233
return conf
228
234
You can’t perform that action at this time.
0 commit comments