Skip to content

Commit

Permalink
Fix input_coverage ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
nbfalcon committed Jan 15, 2022
1 parent 2e7ed00 commit 6cda394
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions coverage/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Opts:
help="Write the JSON report to this file. Defaults to 'coverage.json'",
)
output_coverage = optparse.make_option(
'-o', '', action='store', dest="outfile",
'-o', '', action='store', dest="output_coverage",
metavar="OUTFILE",
help="Write the recorded coverage information to this file. Defaults to '.coverage'"
)
Expand Down Expand Up @@ -588,7 +588,8 @@ def command_line(self, argv):
else:
concurrency = None

data_file = options.outfile if options.action == "run" else None
data_file = getattr(options, "output_coverage", None) \
or getattr(options, "input_coverage", None)
# Do something.
self.coverage = Coverage(
data_file=data_file or DEFAULT_DATAFILE,
Expand Down

0 comments on commit 6cda394

Please sign in to comment.