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-April/078718.html below:

[Python-Dev] Proposed unittest changes

[Python-Dev] Proposed unittest changesGuido van Rossum guido at python.org
Thu Apr 17 19:04:30 CEST 2008
On Thu, Apr 17, 2008 at 8:27 AM, Christian Heimes <lists at cheimes.de> wrote:
>  Most of the etc. could be simplified with a function assertOp which
>  takes an operator as first argument
>
>  import operator
>  def assertOp(self, op, a, b, msg):
>     func = getattr(operator, op)
>     self.assert_(func(a, b) ...)
>
>  assertOp("gt", a, b) == assert a > g

-1 on this; it requires more thinking and has more opportunities for
mistakes (e.g. why "gt" and not ">"?).

>  I also like to have some assert for is, type, isinstance, issubclass and
>  contains.

Yes. Michael had In/NotIn. I have needed all of the others too at various times!

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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