@@ -291,12 +291,15 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
291
291
else :
292
292
cp = HandyConfigParser (our_file )
293
293
294
+ print (f"{ cp = } " )
294
295
self .attempted_config_files .append (filename )
295
296
296
297
try :
297
298
files_read = cp .read (filename )
298
299
except (configparser .Error , TomlDecodeError ) as err :
300
+ print (f"{ err = } " )
299
301
raise ConfigError (f"Couldn't read config file { filename } : { err } " ) from err
302
+ print (f"{ files_read = } " )
300
303
if not files_read :
301
304
return False
302
305
@@ -308,6 +311,7 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
308
311
was_set = self ._set_attr_from_config_option (cp , * option_spec )
309
312
if was_set :
310
313
any_set = True
314
+ print (f"{ any_set = } because { option_spec = } " )
311
315
except ValueError as err :
312
316
raise ConfigError (f"Couldn't read config file { filename } : { err } " ) from err
313
317
@@ -332,20 +336,24 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
332
336
for option in cp .options ('paths' ):
333
337
self .paths [option ] = cp .getlist ('paths' , option )
334
338
any_set = True
339
+ print (f"{ any_set = } because paths:{ option } " )
335
340
336
341
# plugins can have options
337
342
for plugin in self .plugins :
338
343
if cp .has_section (plugin ):
339
344
self .plugin_options [plugin ] = cp .get_section (plugin )
340
345
any_set = True
346
+ print (f"{ any_set = } because { plugin = } :{ option } " )
341
347
342
348
# Was this file used as a config file? If it's specifically our file,
343
349
# then it was used. If we're piggybacking on someone else's file,
344
350
# then it was only used if we found some settings in it.
351
+ print (f"{ our_file = } " )
345
352
if our_file :
346
353
used = True
347
354
else :
348
355
used = any_set
356
+ print (f"{ used = } " )
349
357
350
358
if used :
351
359
self .config_file = os .path .abspath (filename )
@@ -591,7 +599,9 @@ def read_coverage_config(
591
599
files_to_try = config_files_to_try (config_file )
592
600
593
601
for fname , our_file , specified_file in files_to_try :
602
+ print (f"Reading { fname = } " )
594
603
config_read = config .from_file (fname , warn , our_file = our_file )
604
+ print (f"{ config_read = } " )
595
605
if config_read :
596
606
break
597
607
if specified_file :
0 commit comments