Raymond Hettinger added the comment:
Sorry, I don't think this makes the tests any better as all. It is code churn
for no benefit.
In our own code, the "more specific tests" risk hiding important details behind
the abstraction (losing knowledge of what is actually tested). For example, I
don't like that assertIn actually does a "not in" test or that assertIsNot runs
"is". In those two cases, it doesn't make a difference but does hint at the
loss of knowledge.
Also, changing tests carries a higher set of risks than changing other code
because there are no tests-for-the-tests. This means that it would easy to
accidentally break a test from testing what it is supposed to and not know
about it.
The "has a nicer error message" is a vacuous promise. The new output:
Traceback (most recent call last):
File "/Users/raymond/Documents/tmp14.py", line 10, in test_one
self.assertIs(a, b)
AssertionError: a is not b
Isn't any better than the current output:
Traceback (most recent call last):
File "/Users/raymond/Documents/tmp14.py", line 13, in test_two
self.assertTrue(a is b)
AssertionError: False is not true
Both of them show a failing "is" test and the first one mysteriously outputs
"is not" which is technically a different operator (albeit, unimportantly so).
----------
resolution: -> rejected
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20550>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com