16 lines
398 B
ReStructuredText
16 lines
398 B
ReStructuredText
Using :func:`pytest.approx` in a boolean context now raises an error hinting at the proper usage.
|
|
|
|
It is apparently common for users to mistakenly use ``pytest.approx`` like this:
|
|
|
|
.. code-block:: python
|
|
|
|
assert pytest.approx(actual, expected)
|
|
|
|
While the correct usage is:
|
|
|
|
.. code-block:: python
|
|
|
|
assert actual == pytest.approx(expected)
|
|
|
|
The new error message helps catch those mistakes.
|