[docs] unittest documentation

Arthur Goldberg artgoldberg at gmail.com
Wed Jan 31 10:26:04 EST 2018


Hello

The first example in the unittest documentation 
(https://docs.python.org/3.4/library/unittest.html and 
https://docs.python.org/2/library/unittest.html) contains the comment:

    # check that s.split fails when the separator is not a string

However, this comment does not correctly describe the code, and reflects 
a common misconception about testing. More accurately, the comment 
should say:

    # check that s.split fails when the separator is an int

Test code to "check that s.split fails when the separator is not a 
string" would need to test every type other than string, which is 
impossible because the set of possible types is infinite.

Thanks

Arthur


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20180131/a4cf4b16/attachment.html>


More information about the docs mailing list