Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unconditionally combine
  • Loading branch information
thatch committed Apr 28, 2026
commit e8c9eff0d4c7ecb1d35378bec6d80ae635601f57
16 changes: 1 addition & 15 deletions coverage/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,6 @@ class Opts:
action="store_true",
help="Skip files with 100% coverage.",
)
no_combine = optparse.make_option(
"--no-combine",
action="store_true",
dest="no_combine",
help="Don't combine data files before reporting; use the existing data file as-is.",
)
no_skip_covered = optparse.make_option(
"--no-skip-covered",
action="store_false",
Expand Down Expand Up @@ -408,7 +402,6 @@ def __init__(self, **kwargs: Any) -> None:
include=None,
keep=None,
module=None,
no_combine=None,
omit=None,
parallel_mode=None,
precision=None,
Expand Down Expand Up @@ -542,7 +535,6 @@ def get_prog_name(self) -> str:
Opts.datafile_input,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.omit,
]
+ GLOBAL_ARGS,
Expand Down Expand Up @@ -615,7 +607,6 @@ def get_prog_name(self) -> str:
Opts.fail_under,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.omit,
Opts.precision,
Opts.quiet,
Expand Down Expand Up @@ -643,7 +634,6 @@ def get_prog_name(self) -> str:
Opts.fail_under,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.omit,
Opts.output_json,
Opts.json_pretty_print,
Expand All @@ -661,7 +651,6 @@ def get_prog_name(self) -> str:
Opts.fail_under,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.output_lcov,
Opts.omit,
Opts.quiet,
Expand All @@ -679,7 +668,6 @@ def get_prog_name(self) -> str:
Opts.format,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.omit,
Opts.precision,
Opts.sort,
Expand Down Expand Up @@ -720,7 +708,6 @@ def get_prog_name(self) -> str:
Opts.fail_under,
Opts.ignore_errors,
Opts.include,
Opts.no_combine,
Opts.omit,
Opts.output_xml,
Opts.quiet,
Expand Down Expand Up @@ -887,8 +874,7 @@ def command_line(self, argv: list[str]) -> int:
sys.path.insert(0, "")

self.coverage.load()
if not options.no_combine:
self.coverage.combine(strict=False, keep=True)
self.coverage.combine(strict=False, keep=True)

total = None
if options.action == "report":
Expand Down
19 changes: 0 additions & 19 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,25 +398,6 @@ def test_combine_doesnt_confuse_options_with_args(self) -> None:
""",
)

def test_no_combine(self) -> None:
# --no-combine skips the cov.combine() call for each reporting command
for cmd, report_call in [
("annotate", "cov.annotate()"),
("html", "cov.html_report()"),
("json", "cov.json_report()"),
("lcov", "cov.lcov_report()"),
("report", "cov.report(show_missing=None)"),
("xml", "cov.xml_report()"),
]:
self.cmd_executes(
f"{cmd} --no-combine",
f"""\
cov = Coverage()
cov.load()
{report_call}
""",
)

@pytest.mark.parametrize(
"cmd, output",
[
Expand Down