Skip to content

Commit

Permalink
Use --data-file to configure the coverage database
Browse files Browse the repository at this point in the history
Request by maintainer.
  • Loading branch information
nbfalcon committed Jan 21, 2022
1 parent 6cda394 commit 2316b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions coverage/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ class Opts:
help="Write the JSON report to this file. Defaults to 'coverage.json'",
)
output_coverage = optparse.make_option(
'-o', '', action='store', dest="output_coverage",
'', '--data-file', action='store', dest="output_coverage",
metavar="OUTFILE",
help="Write the recorded coverage information to this file. Defaults to '.coverage'"
)
input_coverage = optparse.make_option(
'-c', '--input-coverage', action='store', dest="input_coverage",
'', '--data-file', action='store', dest="input_coverage",
metavar="INPUT",
help="Read coverage data for report generation from this file (needed if you have "
"specified -o previously). Defaults to '.coverage'"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_combine(self):
cov.combine(None, strict=True, keep=False)
cov.save()
""")
self.cmd_executes("combine -o foo.cov", """\
self.cmd_executes("combine --data-file=foo.cov", """\
cov = Coverage(data_file="foo.cov")
cov.combine(None, strict=True, keep=False)
cov.save()
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_erase(self):
cov = Coverage()
cov.erase()
""")
self.cmd_executes("erase -c foo.cov", """\
self.cmd_executes("erase --data-file=foo.cov", """\
cov = Coverage(data_file="foo.cov")
cov.erase()
""")
Expand Down Expand Up @@ -521,7 +521,7 @@ def test_report(self):
cov.load()
cov.report(sort='-foo')
""")
self.cmd_executes("report -c foo.cov.2", """\
self.cmd_executes("report --data-file=foo.cov.2", """\
cov = Coverage(data_file="foo.cov.2")
cov.load()
cov.report(show_missing=None)
Expand Down Expand Up @@ -652,7 +652,7 @@ def test_run(self):
cov.stop()
cov.save()
""")
self.cmd_executes("run -o output.coverage foo.py", """\
self.cmd_executes("run --data-file=output.coverage foo.py", """\
cov = Coverage(data_file="output.coverage")
runner = PyRunner(['foo.py'], as_module=False)
runner.prepare()
Expand Down

0 comments on commit 2316b42

Please sign in to comment.