clarify documentation about tolerance setting in unittest.TestCase.assertAlmost() (#8614)
This commit is contained in:
parent
adc197424d
commit
245eefafcf
|
@ -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``
|
- ``unittest.TestCase.assertAlmostEqual(a, b)``: True if ``a`` and ``b``
|
||||||
are within an absolute tolerance of ``1e-7``. No relative tolerance is
|
are within an absolute tolerance of ``1e-7``. No relative tolerance is
|
||||||
considered and the absolute tolerance cannot be changed, so this function
|
considered , so this function is not appropriate for very large or very
|
||||||
is not appropriate for very large or very small numbers. Also, it's only
|
small numbers. Also, it's only available in subclasses of ``unittest.TestCase``
|
||||||
available in subclasses of ``unittest.TestCase`` and it's ugly because it
|
and it's ugly because it doesn't follow PEP8. `More information...`__
|
||||||
doesn't follow PEP8. `More information...`__
|
|
||||||
|
|
||||||
__ https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual
|
__ https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue