-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
It seems that pytest.approx repr is optimized for very high or very low tolerances, but is not as easily readable as it could be for values in between.
Some examples:
pytest.approx(42, abs=1)repr is42 ± 1.0e+00, which could be just42 ± 1.pytest.approx(5, rel=0.01)repr is5 ± 5.0e-02, but could be5 ± 0.05or maybe even5 ± 1%pytest.approx(24000, abs=500)repr is24000 ± 5.0e+02and could be24000 ± 500- removing accuracy example:
pytest.approx(1500, abs=555)repr is1500 ± 5.6e+02and could be1500 ± 555
In these number ranges using the exact number instead of the exponential notation is both more accurate and easier readable for humans. Please adapt pytest.approx to switch it's repr style according to the input value ranges.
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature