Author vstinner
Recipients serhiy.storchaka, vstinner, xdegaye
Date 2017-11-15.10:47:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> self.assertIsInstance(e.pw_gecos, str)

This test is wrong: it's perfectly fine to get None here.

Python must not test the OS itself, but only test our own code: make sure that Python converts properly C types to nice Python types, so a string or None.

I propose to use something like:

def check_type(field):
    self.assertTrue(field is None or isinstance(field, str), repr(field))

Date User Action Args
2017-11-15 10:47:04vstinnersetrecipients: + vstinner, xdegaye, serhiy.storchaka
2017-11-15 10:47:04vstinnersetmessageid: <>
2017-11-15 10:47:04vstinnerlinkissue32033 messages
2017-11-15 10:47:04vstinnercreate