Message147494
At least in the standard library test suite, it should be useful.
When the test is stricter, it catches errors earlier.
I remember when assertIsInstance was made available (issue #7031), we started to rewrite some expressions
self.assertEqual(type(result), str)
with
self.assertIsInstance(result, str)
Actually, it means we relaxed the test.
Today, I don't want to use assertIsInstance anymore because I want to check the exact type() of the result.
The attached files list the usage of both in Lib/test/*py:
- 325 assertIsInstance
- 234 assert. . .type(. . .)
IMHO, some assertIsInstance can be stricter.
Most of the other type() tests can be replaced with this method. |
|
Date |
User |
Action |
Args |
2011-11-12 14:52:19 | flox | set | recipients:
+ flox, georg.brandl, rhettinger, ezio.melotti, michael.foord |
2011-11-12 14:52:19 | flox | set | messageid: <1321109539.53.0.831806439115.issue13387@psf.upfronthosting.co.za> |
2011-11-12 14:52:18 | flox | link | issue13387 messages |
2011-11-12 14:52:18 | flox | create | |
|