[issue27198] Adding an assertClose() method to unittest.TestCase

Robert Collins report at bugs.python.org
Fri Jun 3 16:41:26 EDT 2016


Robert Collins added the comment:

Thanks for proposing this. I really don't want to add new assertions to unittest, and I certainly don't want to add narrow usage ones like this, nor ones that are confusingly named (this has nothing to do with files, but 'close' is a verb for files, just like equal is a verb for objects.

Instead, I suggest a regular function that will raise AssertionError on failure. The only thing you need _formatMessage for is handling long messages, and I don't think thats useful or relevant for a binary numeric test like this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27198>
_______________________________________


More information about the Python-bugs-list mailing list