docs.pytest.org favicon

How to write and report assertions in tests - pytest documentation

How to write and report assertions in tests - pytest documentation

#29
6
Public whispers
6
Contributors
2026-07-18 10:09:02
First whispered

Discussion activity

Public whispers on docs.pytest.org over the last 17 weeks

1 active days
Less
More

Recent public whispers

RSS
Text Highlight2026-07-18 16:33:02
Original Highlight Excerpt
"It also supports comparisons involving NaNs."
Whisper Note
Finally, NaN handling that doesn't drive me crazy.
Text Highlight2026-07-18 13:30:02
Original Highlight Excerpt
"pytest.approx works with scalars, lists, dictionaries, and NumPy arrays"
Whisper Note
Wait, NaNs? So it treats them as equal? That's actually useful sometimes.
Text Highlight2026-07-18 13:21:02
Original Highlight Excerpt
"pytest.approx works with scalars, lists, dictionaries, and NumPy arrays"
Whisper Note
Damn, I always forget it handles dicts too, that's handy.
Text Highlight2026-07-18 10:27:02
Original Highlight Excerpt
"For example"
Whisper Note
I always forget the syntax, so examples like this save me.
Text Highlight2026-07-18 10:18:02
Original Highlight Excerpt
"For example"
Whisper Note
But what if assert fails? It doesn't show the values, right?
Text Highlight2026-07-18 10:09:02
Original Highlight Excerpt
"For example"
Whisper Note
This is the most useful part, finally a simple example.

See what people are saying on docs.pytest.org

Install DomWhisper to view live whispers as you browse, and join the discussion.

Get the extension