From 06745d83c785bf7483294827eb566d614827f9e9 Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Tue, 3 May 2022 10:32:28 -0400 Subject: [PATCH] Use actual order of comparison --- doc/en/how-to/doctest.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index 4148aa682..021ba274f 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -129,7 +129,8 @@ pytest also introduces new options: the precision you have written in the expected doctest output. The numbers are compared using :func:`pytest.approx` with relative tolerance equal to the precision. For example, the following output would only need to match to 2 - decimal places according to ``pytest.approx(3.14, rel=10**-2)``:: + decimal places when comparing ``3.14`` to + ``pytest.approx(math.pi, rel=10**-2)``:: >>> math.pi 3.14