(self, exc, obj, methodname, *args, expected_msg=None)
| 76 | |
| 77 | # check that obj.method(*args) raises exc |
| 78 | def checkraises(self, exc, obj, methodname, *args, expected_msg=None): |
| 79 | obj = self.fixtype(obj) |
| 80 | args = self.fixtype(args) |
| 81 | with self.assertRaises(exc) as cm: |
| 82 | getattr(obj, methodname)(*args) |
| 83 | self.assertNotEqual(str(cm.exception), '') |
| 84 | if expected_msg is not None: |
| 85 | self.assertEqual(str(cm.exception), expected_msg) |
| 86 | |
| 87 | # call obj.method(*args) without any checks |
| 88 | def checkcall(self, obj, methodname, *args): |
no test coverage detected