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/2015-July/140748.html below:

[Python-Dev] How far to go with user-friendliness

[Python-Dev] How far to go with user-friendliness [Python-Dev] How far to go with user-friendlinessA.M. Kuchling amk at amk.ca
Tue Jul 14 23:41:14 CEST 2015
On Tue, Jul 14, 2015 at 09:53:33AM -0700, Ethan Furman wrote:
> Part of writing tests is making sure they fail (and for the right reason) -- proper testing of the tests would reveal such a typo.

And there are other failure modes for writing tests that succeed but
are not testing what you think.  For example, you might re-use the
same method name:

   def test_connection(self):
       # Never executed
       ...

   ... 200 lines and 10 other test methods later ...

   def test_connection(self):
       ...

Or misuse assertRaises:

   with self.assertRaises(TypeError):
       1 + "a"
       # Second statement never reached
       [] + 'b'

I don't think unittest can protect its users from such things.

--amk
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