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