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 41c04f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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
6 changes: 3 additions & 3 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
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 41c04f6

Please sign in to comment.