[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual
Raymond Hettinger
report at bugs.python.org
Mon Nov 22 01:07:14 CET 2010
Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:
Rejecting this one for reasons we discussed earlier. The assertEqual() method needs to be the primary interface. Everything else is starting to mix content and presentation (i.e. passing in separators). The existing repr() works fine with bytes and Michael's suggested ascii() cast would be the preferred technique in the common cases.
What might be useful is a less specialized patch letting assertEqual() take an argument pointing to some repr or pre-processing function that would be called after an equality test fails but before it is diffed. That would support a clear separation of concerns and be easily extendable by users would need something more than an ascii() cast.
----------
resolution: later -> rejected
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10164>
_______________________________________
More information about the Python-bugs-list
mailing list