We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
cover of episode pytest-md and pytest-md-report: Markdown reports for pytest

pytest-md and pytest-md-report: Markdown reports for pytest

2025/3/1
logo of podcast Test & Code

Test & Code

AI Deep Dive AI Chapters Transcript
People
B
Brian Okken
Topics
Brian Okken: 我讨论了两个 pytest 插件:pytest-md 和 pytest-md-report。pytest-md 生成简单的 markdown 格式的测试报告,支持详细输出和 emoji。虽然它最近没有更新,但仍然可以在较新的 Python 和 pytest 版本上运行。pytest-md-report 生成更复杂的 markdown 表格形式的测试报告,包含文件路径、通过、失败、错误、跳过、xfail 和 xpass 等信息,并用颜色编码显示测试结果。它支持详细报告,可以显示每个测试函数的结果,并提供多种配置选项,例如忽略值为零的列、自定义颜色、支持多种 markdown 格式以及排除列。这两个插件的代码量都不大,并且是开源的,可以作为学习和参考。我个人更推荐 pytest-md-report,因为它具有彩色编码的表格和独立的详细模式,使用起来更方便。

Deep Dive

Chapters
This chapter explores the standard pytest output and introduces two plugins, pytest-md and pytest-md-report, that enhance reporting capabilities by generating markdown reports. It discusses their features and functionalities, including markdown table formatting and customization options.
  • pytest's standard output has improved significantly, offering percentages, test file details, and test case results.
  • pytest-md generates markdown reports summarizing test results (pass/fail/skip).
  • pytest-md supports verbose output with more details and emojis.
  • pytest-md's last update was in 2019, but it still functions well with newer Python versions.

Shownotes Transcript

Markdown reports as either text or markdown tables.Two fun plugins discussed.

Links:

** Learn pytest**

** ★ Support this podcast on Patreon ★) **