assertRaises () can also be used as a context manager like so: mycalc = MyCalc(1, 0) with self.assertRaises(ValueError): mycalc.mod_divide() This code ...
確定! 回上一頁