Message147480
Sometimes we want to check the exact type of an object.
The method assertIsInstance could be misleading in such case.
The current workaround is:
assertIs(type(obj), some_class)
However we can add an argument to the method to keep the benefit of having a nice failure message.
Examples:
assertIsInstance(stdobj, dict, exact_type=True)
assertIsInstance(myobj, dict, exact_type=MyDict) |
|
Date |
User |
Action |
Args |
2011-11-12 12:43:22 | flox | set | recipients:
+ flox, georg.brandl, michael.foord |
2011-11-12 12:43:22 | flox | set | messageid: <1321101802.89.0.94542095022.issue13387@psf.upfronthosting.co.za> |
2011-11-12 12:43:22 | flox | link | issue13387 messages |
2011-11-12 12:43:22 | flox | create | |
|