Skip to content

Commit 33c83d6

Browse files
committed
debug #1516
1 parent 012a687 commit 33c83d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

coverage/config.py

+8
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
297297
files_read = cp.read(filename)
298298
except (configparser.Error, TomlDecodeError) as err:
299299
raise ConfigError(f"Couldn't read config file {filename}: {err}") from err
300+
print(f"{files_read=}")
300301
if not files_read:
301302
return False
302303

@@ -308,6 +309,7 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
308309
was_set = self._set_attr_from_config_option(cp, *option_spec)
309310
if was_set:
310311
any_set = True
312+
print(f"{any_set=} because {option_spec=}")
311313
except ValueError as err:
312314
raise ConfigError(f"Couldn't read config file {filename}: {err}") from err
313315

@@ -332,20 +334,24 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
332334
for option in cp.options('paths'):
333335
self.paths[option] = cp.getlist('paths', option)
334336
any_set = True
337+
print(f"{any_set=} because paths:{option}")
335338

336339
# plugins can have options
337340
for plugin in self.plugins:
338341
if cp.has_section(plugin):
339342
self.plugin_options[plugin] = cp.get_section(plugin)
340343
any_set = True
344+
print(f"{any_set=} because {plugin=}:{option}")
341345

342346
# Was this file used as a config file? If it's specifically our file,
343347
# then it was used. If we're piggybacking on someone else's file,
344348
# then it was only used if we found some settings in it.
349+
print(f"{our_file=}")
345350
if our_file:
346351
used = True
347352
else:
348353
used = any_set
354+
print(f"{used=}")
349355

350356
if used:
351357
self.config_file = os.path.abspath(filename)
@@ -591,7 +597,9 @@ def read_coverage_config(
591597
files_to_try = config_files_to_try(config_file)
592598

593599
for fname, our_file, specified_file in files_to_try:
600+
print(f"Reading {fname=}")
594601
config_read = config.from_file(fname, warn, our_file=our_file)
602+
print(f"{config_read=}")
595603
if config_read:
596604
break
597605
if specified_file:

0 commit comments

Comments
 (0)