|
16 | 16 |
|
17 | 17 | import coverage |
18 | 18 | from coverage.data import CoverageData |
19 | | -from coverage.misc import CoverageException |
20 | 19 | from coverage.sqldata import filename_suffix |
21 | 20 |
|
22 | 21 | from . import CentralCovContextWarning |
@@ -256,26 +255,17 @@ def summary(self, stream): |
256 | 255 | total = self.cov.json_report(ignore_errors=True, outfile=output) |
257 | 256 | stream.write('Coverage JSON written to file %s\n' % (self.cov.config.json_output if output is None else output)) |
258 | 257 |
|
259 | | - # Check that markdown and markdown-append don't point to same file |
260 | | - if all(x in self.cov_report for x in ['markdown', 'markdown-append']): |
261 | | - markdown_file = self.cov_report['markdown'] or 'coverage.md' |
262 | | - markdown_append_file = self.cov_report['markdown-append'] or 'coverage.md' |
263 | | - if markdown_file == markdown_append_file: |
264 | | - error_message = f"markdown and markdown-append options cannot point to the same file: '{markdown_file}'." |
265 | | - error_message += ' Please redirect one of them using :DEST (e.g. --cov-report=markdown:dest_file.md)' |
266 | | - raise CoverageException(error_message) |
267 | | - |
268 | 258 | # Produce Markdown report if wanted. |
269 | 259 | if 'markdown' in self.cov_report: |
270 | | - output = self.cov_report['markdown'] or 'coverage.md' |
| 260 | + output = self.cov_report['markdown'] |
271 | 261 | with _backup(self.cov, 'config'): |
272 | 262 | with Path(output).open('w') as output_file: |
273 | 263 | total = self.cov.report(ignore_errors=True, file=output_file, output_format='markdown') |
274 | 264 | stream.write(f'Coverage Markdown information written to file {output}\n') |
275 | 265 |
|
276 | 266 | # Produce Markdown report if wanted, appending to output file |
277 | 267 | if 'markdown-append' in self.cov_report: |
278 | | - output = self.cov_report['markdown-append'] or 'coverage.md' |
| 268 | + output = self.cov_report['markdown-append'] |
279 | 269 | with _backup(self.cov, 'config'): |
280 | 270 | with Path(output).open('a') as output_file: |
281 | 271 | total = self.cov.report(ignore_errors=True, file=output_file, output_format='markdown') |
|
0 commit comments