def testLpxKkt(self): lp = LPX() with self.assertRaises(RuntimeError) as cm: lp.kkt() self.assertIn( 'cannot get KKT when primal or dual basic solution undefined', str(cm.exception) )