Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage run: add a -o option #1304

Closed
Closed
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
Use --data-file to configure the coverage database
Request by maintainer.
nbfalcon committed Jan 21, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2316b42d8e6d6f57156944cb4b689b4f6c82c10a
4 changes: 2 additions & 2 deletions coverage/cmdline.py
Original file line number Diff line number Diff line change
@@ -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'"
8 changes: 4 additions & 4 deletions tests/test_cmdline.py
Original file line number Diff line number Diff line change
@@ -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()
@@ -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()
""")
@@ -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)
@@ -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()