@@ -148,6 +148,8 @@ def test_foo(cov):
148148DEST_DIR = 'cov_dest'
149149XML_REPORT_NAME = 'cov.xml'
150150JSON_REPORT_NAME = 'cov.json'
151+ MARKDOWN_REPORT_NAME = 'cov.md'
152+ MARKDOWN_APPEND_REPORT_NAME = 'cov-append.md'
151153LCOV_REPORT_NAME = 'cov.info'
152154
153155xdist_params = pytest .mark .parametrize (
@@ -360,6 +362,61 @@ def test_json_output_dir(testdir):
360362 assert result .ret == 0
361363
362364
365+ def test_markdown_output_dir (testdir ):
366+ script = testdir .makepyfile (SCRIPT )
367+
368+ result = testdir .runpytest ('-v' , '--cov=%s' % script .dirpath (), '--cov-report=markdown:' + MARKDOWN_REPORT_NAME , script )
369+
370+ result .stdout .fnmatch_lines (
371+ [
372+ '*_ coverage: platform *, python * _*' ,
373+ 'Coverage Markdown information written to file ' + MARKDOWN_REPORT_NAME ,
374+ '*10 passed*' ,
375+ ]
376+ )
377+ assert testdir .tmpdir .join (MARKDOWN_REPORT_NAME ).check ()
378+ assert result .ret == 0
379+
380+
381+ def test_markdown_append_output_dir (testdir ):
382+ script = testdir .makepyfile (SCRIPT )
383+
384+ result = testdir .runpytest ('-v' , '--cov=%s' % script .dirpath (), '--cov-report=markdown-append:' + MARKDOWN_APPEND_REPORT_NAME , script )
385+
386+ result .stdout .fnmatch_lines (
387+ [
388+ '*_ coverage: platform *, python * _*' ,
389+ 'Coverage Markdown information appended to file ' + MARKDOWN_APPEND_REPORT_NAME ,
390+ '*10 passed*' ,
391+ ]
392+ )
393+ assert testdir .tmpdir .join (MARKDOWN_APPEND_REPORT_NAME ).check ()
394+ assert result .ret == 0
395+
396+
397+ def test_markdown_and_markdown_append_work_together (testdir ):
398+ script = testdir .makepyfile (SCRIPT )
399+
400+ result = testdir .runpytest (
401+ '-v' ,
402+ '--cov=%s' % script .dirpath (),
403+ '--cov-report=markdown:' + MARKDOWN_REPORT_NAME ,
404+ '--cov-report=markdown-append:' + MARKDOWN_APPEND_REPORT_NAME ,
405+ script ,
406+ )
407+
408+ result .stdout .fnmatch_lines (
409+ [
410+ '*_ coverage: platform *, python * _*' ,
411+ 'Coverage Markdown information written to file ' + MARKDOWN_REPORT_NAME ,
412+ 'Coverage Markdown information appended to file ' + MARKDOWN_APPEND_REPORT_NAME ,
413+ '*10 passed*' ,
414+ ]
415+ )
416+ assert testdir .tmpdir .join (MARKDOWN_APPEND_REPORT_NAME ).check ()
417+ assert result .ret == 0
418+
419+
363420@pytest .mark .skipif ('coverage.version_info < (6, 3)' )
364421def test_lcov_output_dir (testdir ):
365422 script = testdir .makepyfile (SCRIPT )
0 commit comments