A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-July/081233.html below:

[Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

[Python-Dev] PEP: Frequently-requested additional features for the `unittest` module [Python-Dev] PEP: Frequently-requested additional features for the `unittest` moduleScott 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4