Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approx() documentation page incorrectly compares with unittest as of 3.2 #8587

Closed
Pentracchiano opened this issue Apr 25, 2021 · 1 comment · Fixed by #8614
Closed

approx() documentation page incorrectly compares with unittest as of 3.2 #8587

Pentracchiano opened this issue Apr 25, 2021 · 1 comment · Fixed by #8614
Labels
topic: approx related to pytest.approx function type: docs documentation improvement, missing or needing clarification

Comments

@Pentracchiano
Copy link

Hello!
While navigating on the docs, I found that the approx() documentation, while comparing its usage to the analogous function in unittest, says:

unittest.TestCase.assertAlmostEqual(a, b): True if a and b are within an absolute tolerance of 1e-7. No relative tolerance is considered and the absolute tolerance cannot be changed, so this function is not appropriate for very large or very small numbers.

This statement is not true as of unittest version 3.2, as:

Changed in version 3.2: [...] Added the delta keyword argument.

which lets a user choose the desired level of tolerance.

I am not a pytest user (yet), so I don't know what I could change that statement to, just pointing that out to someone who does.

@Zac-HD Zac-HD added topic: approx related to pytest.approx function type: docs documentation improvement, missing or needing clarification labels Apr 26, 2021
@Zac-HD
Copy link
Member

Zac-HD commented Apr 26, 2021

(docs for pytest.approx() and assertAlmostEqual)

Even now, delta only allows you to set a different absolute tolerance (not relative tolerance). I'd therefore just delete the words "and the absolute tolerance cannot be changed" from our docs. Would you like to open a pull request with this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: approx related to pytest.approx function type: docs documentation improvement, missing or needing clarification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants