How to write and report assertions in tests - pytest documentation
How to write and report assertions in tests - pytest documentation
6
公开标注数
6
参与人数
2026-07-18 10:09:02
首次 Whisper
讨论活跃度
docs.pytest.org 近 17 周的公开 Whisper
少多
最新公开 Whisper
划选高亮2026-07-18 16:33:02
原文高亮摘录
“It also supports comparisons involving NaNs.”
Whisper 随想笔记
Finally, NaN handling that doesn't drive me crazy.
划选高亮2026-07-18 13:30:02
原文高亮摘录
“pytest.approx works with scalars, lists, dictionaries, and NumPy arrays”
Whisper 随想笔记
Wait, NaNs? So it treats them as equal? That's actually useful sometimes.
划选高亮2026-07-18 13:21:02
原文高亮摘录
“pytest.approx works with scalars, lists, dictionaries, and NumPy arrays”
Whisper 随想笔记
Damn, I always forget it handles dicts too, that's handy.
划选高亮2026-07-18 10:27:02
原文高亮摘录
“For example”
Whisper 随想笔记
I always forget the syntax, so examples like this save me.
划选高亮2026-07-18 10:18:02
原文高亮摘录
“For example”
Whisper 随想笔记
But what if assert fails? It doesn't show the values, right?
划选高亮2026-07-18 10:09:02
原文高亮摘录
“For example”
Whisper 随想笔记
This is the most useful part, finally a simple example.