Skip to content

Commit 79e2095

Browse files
committed
debug #1516
1 parent 012a687 commit 79e2095

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

coverage/config.py

+9
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
296296
try:
297297
files_read = cp.read(filename)
298298
except (configparser.Error, TomlDecodeError) as err:
299+
print(f"{err=}")
299300
raise ConfigError(f"Couldn't read config file {filename}: {err}") from err
301+
print(f"{files_read=}")
300302
if not files_read:
301303
return False
302304

@@ -308,6 +310,7 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
308310
was_set = self._set_attr_from_config_option(cp, *option_spec)
309311
if was_set:
310312
any_set = True
313+
print(f"{any_set=} because {option_spec=}")
311314
except ValueError as err:
312315
raise ConfigError(f"Couldn't read config file {filename}: {err}") from err
313316

@@ -332,20 +335,24 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
332335
for option in cp.options('paths'):
333336
self.paths[option] = cp.getlist('paths', option)
334337
any_set = True
338+
print(f"{any_set=} because paths:{option}")
335339

336340
# plugins can have options
337341
for plugin in self.plugins:
338342
if cp.has_section(plugin):
339343
self.plugin_options[plugin] = cp.get_section(plugin)
340344
any_set = True
345+
print(f"{any_set=} because {plugin=}:{option}")
341346

342347
# Was this file used as a config file? If it's specifically our file,
343348
# then it was used. If we're piggybacking on someone else's file,
344349
# then it was only used if we found some settings in it.
350+
print(f"{our_file=}")
345351
if our_file:
346352
used = True
347353
else:
348354
used = any_set
355+
print(f"{used=}")
349356

350357
if used:
351358
self.config_file = os.path.abspath(filename)
@@ -591,7 +598,9 @@ def read_coverage_config(
591598
files_to_try = config_files_to_try(config_file)
592599

593600
for fname, our_file, specified_file in files_to_try:
601+
print(f"Reading {fname=}")
594602
config_read = config.from_file(fname, warn, our_file=our_file)
603+
print(f"{config_read=}")
595604
if config_read:
596605
break
597606
if specified_file:

0 commit comments

Comments
 (0)