How to write and report assertions in tests - pytest documentation
6
公开标注数
6
参与人数
2026-07-18 10:09:02
首次 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.
分享本页 Whisper
短链接
https://domwhisper.com/s/49c7336f0295嵌入代码
<iframe src="https://domwhisper.com/embed/49c7336f0295" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>