Closed asottile closed 9 years ago
+1
@wting also what does "not identity" mean?
Hmm, from what I understand people are using assert_true()
on multiple variables but instead the second one is being assigned to message and thus silently passing? This sounds like a good change to me.
Identity refers to truthiness vs is True
. In retrospect these should have been named assert_truthy()
and assert_falsy()
and assert_true()
would compare is True
.
If you're making a backwards incompatible change, is it OK if we change the function names to communicate truthiness better?
Via #293
I've seen code like this in three separate code reviews over the last two weeks:
From the cases I've seen, the programmer actually wanted
T.assert_equal(...)
instead. But turned their test into a noop (aside: a good test fails when you write it and then you make it succeed so admittedly there's a test-theory-education-problem component to this)Which does something along the lines of:
My proposal (breaks API):
Existing code
New code:
The same applies for
assert_false
.Tagging @wting who added these (why?)