Skip to content

Commit 41c04f6

Browse files
committed
Use --data-file to configure the coverage database
Request by maintainer.
1 parent 6cda394 commit 41c04f6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

coverage/cmdline.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ class Opts:
125125
help="Write the JSON report to this file. Defaults to 'coverage.json'",
126126
)
127127
output_coverage = optparse.make_option(
128-
'-o', '', action='store', dest="output_coverage",
128+
'', '--data-file', action='store', dest="output_coverage",
129129
metavar="OUTFILE",
130130
help="Write the recorded coverage information to this file. Defaults to '.coverage'"
131131
)
132132
input_coverage = optparse.make_option(
133-
'-c', '--input-coverage', action='store', dest="input_coverage",
133+
'', '--data-file', action='store', dest="input_coverage",
134134
metavar="INPUT",
135135
help="Read coverage data for report generation from this file (needed if you have "
136136
"specified -o previously). Defaults to '.coverage'"

tests/test_cmdline.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_erase(self):
307307
cov = Coverage()
308308
cov.erase()
309309
""")
310-
self.cmd_executes("erase -c foo.cov", """\
310+
self.cmd_executes("erase --data-file=foo.cov", """\
311311
cov = Coverage(data_file="foo.cov")
312312
cov.erase()
313313
""")
@@ -521,7 +521,7 @@ def test_report(self):
521521
cov.load()
522522
cov.report(sort='-foo')
523523
""")
524-
self.cmd_executes("report -c foo.cov.2", """\
524+
self.cmd_executes("report --data-file=foo.cov.2", """\
525525
cov = Coverage(data_file="foo.cov.2")
526526
cov.load()
527527
cov.report(show_missing=None)
@@ -652,7 +652,7 @@ def test_run(self):
652652
cov.stop()
653653
cov.save()
654654
""")
655-
self.cmd_executes("run -o output.coverage foo.py", """\
655+
self.cmd_executes("run --data-file=output.coverage foo.py", """\
656656
cov = Coverage(data_file="output.coverage")
657657
runner = PyRunner(['foo.py'], as_module=False)
658658
runner.prepare()

0 commit comments

Comments
 (0)