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

Barry Warsaw barry at python.org
Wed Mar 19 14:54:12 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 19, 2008, at 3:20 AM, Jeffrey Yasskin wrote:

> +1 to assert* from me. the fail* variants always feel like
> double-negatives. I also always use assertTrue instead of assert_. But
> I don't care enough to argue about it. :)

I'm in the camp that Gabriel describes.  I prefer assertEqual/ 
assertRaises and failIf/failUnless.

I like the latter because it reads nicely: fail unless [this thing is  
true], fail if [this thing is true].

OTOH, I'd rather there be OOWTDI so whatever the consensus is is fine  
with me.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iQCVAwUBR+EbBXEjvBPtnXfVAQIWDAQAi3/aoOhxeeeY85J4GEAW8hk3ONBQTUi8
jSdm62ooDndcuROZbC2EqfEGJJvX/JnbwstT195HD1EpsOohtA9tObZ294BO5vpg
4lEQhqqXlkQsZEgwM6+pcW8xUI3mv0HPiT/HZZZj/+71FpToSElist/l/sLYIvZv
At7qT4DFKeo=
=jyxp
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list