doc: clarify the behavior of approx#13341
Conversation
|
This seems like a very special case, so IMHO this should be mentioned somewhere further down with the other notes, but certainly not in the first two sentences before even explaining what the function is there for. |
Thanks @The-Compiler for your comment. I moved the note further down as you suggested and added an example. Could you please take a look at my update? |
src/_pytest/python_api.py
Outdated
| >>> ["foo", 1.0000005] == approx([None,1]) | ||
| False | ||
|
|
||
| Note that unlike built-in equality, this function considers |
There was a problem hiding this comment.
I like the note and the example, but how about moving this to a proper .. note:: section, similar to the one we have at the bottom?
pytest/src/_pytest/python_api.py
Lines 684 to 693 in 9a7dbd8
I would add your section under a .. note:: after that one about numpy arrays.
There was a problem hiding this comment.
Thanks @nicoddemus for reviewing this PR!
I just pushed a commit to address your comment. CI is green.
for more information, see https://pre-commit.ci
Backport to 8.3.x: 💚 backport PR created✅ Backport PR branch: Backported as #13352 🤖 @patchback |
|
Thanks @natmokval! |
A small documentation fix to clarify the behavior of
approx.closes #13218