Package: pytest-md-report
pytest-md-reportSummaryInstallationUsageOther examplesConfig file examplesAdd report to pull requestsOptionsCommand optionsini-optionsDependenciesSummaryA pytest plugin to make test results report with Markdown table format.Installationpip install pytest-md-reportUsagepytest --md-report examples/Output exampleOther examplesIncrease verbosity level (--md-report-verboseoption):pytest --md-report --md-report-verbose=1 examples/Output example (verbose)Not rendering results of zero value (--md-report-zerosemmptyoption):pytest --md-report --md-report-zeros empty --md-report-color never examples/|         filepath         | passed | failed | error | skipped | xfailed | xpassed | SUBTOTAL |
| ------------------------ | -----: | -----: | ----: | ------: | ------: | ------: | -------: |
| examples/test_error.py   |        |        |     2 |         |         |         |        2 |
| examples/test_failed.py  |        |      2 |       |         |         |         |        2 |
| examples/test_pass.py    |      2 |        |       |         |         |         |        2 |
| examples/test_skipped.py |        |        |       |       2 |         |         |        2 |
| examples/test_xfailed.py |        |        |       |         |       2 |         |        2 |
| examples/test_xpassed.py |        |        |       |         |         |       2 |        2 |
| TOTAL                    |      2 |      2 |     2 |       2 |       2 |       2 |       12 |Generate GitHub Flavored Markdown (GFM) report:pytest --md-report --md-report-flavor gfm examples/GFM rendering result can be seen athere.Config file examplesYou can set configurations withpyproject.tomlorsetup.cfgas follows.Example ofpyproject.toml:[tool.pytest.ini_options]md_report=truemd_report_verbose=0md_report_color="auto"Example ofsetup.cfg:[tool:pytest]md_report=Truemd_report_verbose=0md_report_color=autoAdd report to pull requestsYou can add test reports to pull requests by GitHub actions workflow like the below:name:md-reporton:pull_request:jobs:run-tests:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-uses:actions/setup-python@v4with:python-version:'3.11'cache:pip-name:Install dependenciesrun:pip install --upgrade pytest-md-report-name:Run testsrun:pytest --md-report --md-report-flavor gfm --md-report-output md_report.md-name:Render reports to the PR when tests failif:failure()env:GH_TOKEN:${{ github.token }}PR_NUMBER:${{ github.event.number }}run:gh pr comment $PR_NUMBER --body-file md_report.mdRendering resultOptionsCommand optionsmake test results report with markdown table format:
  --md-report           Create Markdown report. you can also specify the value
                        with PYTEST_MD_REPORT environment variable.
  --md-report-verbose=VERBOSITY_LEVEL
                        Verbosity level for pytest-md-report.
                        If not set, use the verbosity level of pytest.
                        Defaults to 0.
                        you can also specify the value with
                        PYTEST_MD_REPORT_VERBOSE environment variable.
  --md-report-output=FILEPATH
                        Path to a file to the outputs test report.
                        Overwrite a file content if the file already exists.
                        you can also specify the value with
                        PYTEST_MD_REPORT_OUTPUT environment variable.
  --md-report-tee       output test report for both standard output and a file.
                        you can also specify the value with PYTEST_MD_REPORT_TEE
                        environment variable.
  --md-report-color={auto,text,never}
                        How coloring output reports.
                        auto: detect the output destination and colorize reports
                        appropriately with the output.
                        for terminal output, render colored (text and
                        background) reports using ANSI escape codes.
                        for file output, render the report without color.
                        text: render colored text reports by using ANSI escape
                        codes.
                        never: render report without color.
                        Defaults to 'auto'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_COLOR environment variable.
  --md-report-margin=MARGIN
                        Margin size for each cell.
                        Defaults to 1.
                        you can also specify the value with
                        PYTEST_MD_REPORT_MARGIN environment variable.
  --md-report-zeros={number,empty}
                        Rendering method for results of zero values.
                        number: render as a digit number (0).
                        empty: not rendering.
                        Automatically set to 'number' when CI environment
                        variable is set to
                        TRUE (case insensitive) to display reports correctly at
                        CI services.
                        Defaults to 'number'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_ZEROS environment variable.
  --md-report-success-color=MD_REPORT_SUCCESS_COLOR
                        Text color of succeeded results.
                        Specify a color name (one of the black/red/green/yellow/
                        blue/magenta/cyan/white/lightblack/lightred/lightgreen/l
                        ightyellow/lightblue/lightmagenta/lightcyan/lightwhite)
                        or a color code (e.g. #ff1020).
                        Defaults to 'light_green'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_SUCCESS_COLOR environment variable.
  --md-report-skip-color=MD_REPORT_SKIP_COLOR
                        Text color of skipped results.
                        Specify a color name (one of the black/red/green/yellow/
                        blue/magenta/cyan/white/lightblack/lightred/lightgreen/l
                        ightyellow/lightblue/lightmagenta/lightcyan/lightwhite)
                        or a color code (e.g. #ff1020).
                        Defaults to 'light_yellow'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_SKIP_COLOR environment variable.
  --md-report-error-color=MD_REPORT_ERROR_COLOR
                        Text color of failed results.
                        Specify a color name (one of the black/red/green/yellow/
                        blue/magenta/cyan/white/lightblack/lightred/lightgreen/l
                        ightyellow/lightblue/lightmagenta/lightcyan/lightwhite)
                        or a color code (e.g. #ff1020).
                        Defaults to 'light_red'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_ERROR_COLOR environment variable.
  --md-report-flavor={common_mark,github,gfm,jekyll,kramdown}
                        Markdown flavor of the output report.
                        Defaults to 'common_mark'.
                        you can also specify the value with
                        PYTEST_MD_REPORT_FLAVOR environment variable.ini-options[pytest] ini-options in the firstpytest.ini/tox.ini/setup.cfg/pyproject.toml (pytest 6.0.0 or later)file found:md_report (bool):     Create Markdown report.
md_report_verbose (string):
                      Verbosity level for pytest-md-report. If not set, use
                      the verbosity level of pytest. Defaults to 0.
md_report_color (string):
                      How coloring output reports. auto: detect the output
                      destination and colorize reports appropriately with the
                      output. for terminal output, render colored (text and
                      background) reports using ANSI escape codes. for file
                      output, render the report without color. text: render
                      colored text reports by using ANSI escape codes. never:
                      render report without color. Defaults to 'auto'.
md_report_output (string):
                      Path to a file to the outputs test report. Overwrite a
                      file content if the file already exists.
md_report_tee (string):
                      output test report for both standard output and a file.
md_report_margin (string):
                      Margin size for each cell. Defaults to 1.
md_report_zeros (string):
                      Rendering method for results of zero values. number:
                      render as a digit number (0). empty: not rendering.
                      Automatically set to 'number' when CI environment
                      variable is set to TRUE (case insensitive) to display
                      reports correctly at CI services. Defaults to 'number'.
md_report_success_color (string):
                      Text color of succeeded results. Specify a color name
                      (one of the black/red/green/yellow/blue/magenta/cyan/whi
                      te/lightblack/lightred/lightgreen/lightyellow/lightblue/
                      lightmagenta/lightcyan/lightwhite) or a color code (e.g.
                      #ff1020). Defaults to 'light_green'.
md_report_skip_color (string):
                      Text color of skipped results. Specify a color name (one
                      of the black/red/green/yellow/blue/magenta/cyan/white/li
                      ghtblack/lightred/lightgreen/lightyellow/lightblue/light
                      magenta/lightcyan/lightwhite) or a color code (e.g.
                      #ff1020). Defaults to 'light_yellow'.
md_report_error_color (string):
                      Text color of failed results. Specify a color name (one
                      of the black/red/green/yellow/blue/magenta/cyan/white/li
                      ghtblack/lightred/lightgreen/lightyellow/lightblue/light
                      magenta/lightcyan/lightwhite) or a color code (e.g.
                      #ff1020). Defaults to 'light_red'.
md_report_flavor (string):
                      Markdown flavor of the output report. Defaults to
                      'common_mark'.DependenciesPython 3.7+Python package dependencies (automatically installed)