[Python-Dev] fcmp() in test.support

Eli Bendersky eliben at gmail.com
Fri Jan 28 05:55:22 CET 2011


I'm working on improving the .rst documentation of test.support (Issue
11015), and came upon the undocumented "fcmp" function that's being
exported from test.support, along with a "FUZZ"constant.

As I search through the tests (py3k trunk), I see fcmp() is being used
only in two places in a fairly trivial way:
1. test_float: where it can be directly replaced by assertAlmostEqual
from unittest
2. test_builtin: where the assertion can also be easily rewritten in
terms of assertAlmostEqual

Although fcmp seems to provide extra functionality over
assertAlmostEqual, the above makes me think it should probably be
removed altogether, or added to unittest if it's still deemed
important.

+/- ?
Eli


More information about the Python-Dev mailing list