[Python-Dev] PEP: Frequently-requested additional features for the `unittest` module
Scott David Daniels
Scott.Daniels at Acm.Org
Wed Jul 16 15:13:53 CEST 2008
Ben Finney wrote:
...
> def assert_compare_true(op, first, second, msg=None):
> if msg is None:
> msg = "%(first)r %(op)r %(second)" % vars()
> if not op(first, second):
> raise self.failure_exception(msg)
I would rather something more like:
def assert_compare_true(op, first, second, msg=None):
if op(first, second):
return
raise self.failure_exception(msg)
if msg is None:
self.failure_exception("%(first)r %(op)r %(second)"
% vars())
self.failure_exception("%(first)r %(op)r %(second): %(msg)"
% vars())
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-Dev
mailing list