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

[Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses

[Python-Dev] unittest's redundant assertions: asserts vs. failIf/UnlessesAndrew Bennetts andrew-pythondev at puzzling.org
Sun Jul 13 13:46:53 CEST 2008
Ben Finney wrote:
> "Guido van Rossum" <guido at python.org> writes:
[...]
> > I like using only the assertKeyword variants, removing assert_, fail*,
> > and assertEquals.
> 
> I'm the opposite. I prefer the 'fail*' variants over the 'assert*'
> variants, because "fail" tells me exactly what the function will *do*,
> while "assert" leaves it implicit what will actually happen if the
> assertion is false.
> 
> For this reason, I'd prefer the "fail*" names to be recommended, and
> the "assert*" names to be, if not deprecated, then at least
> second-class citizens.

On the other hand, “assert*” names are positive statements of what the behaviour 
of the system-under-test is.  And conversely, “fail*” names are a bit like
implementation details of how the test is written.  So I personally have a mild
preference for the assert* names.

My suspicion is that it will be very hard to get consensus on the colour of this
particular bike shed :)

-Andrew.

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