From 245eefafcf417df7390457b86ad607e19686f83f Mon Sep 17 00:00:00 2001 From: Rahul Kumaresan Date: Wed, 5 May 2021 17:53:39 +0530 Subject: [PATCH] clarify documentation about tolerance setting in unittest.TestCase.assertAlmost() (#8614) --- src/_pytest/python_api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index e1ee057a4..a2ee63d16 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -640,10 +640,9 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: - ``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. Also, it's only - available in subclasses of ``unittest.TestCase`` and it's ugly because it - doesn't follow PEP8. `More information...`__ + considered , so this function is not appropriate for very large or very + small numbers. Also, it's only available in subclasses of ``unittest.TestCase`` + and it's ugly because it doesn't follow PEP8. `More information...`__ __ https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual