def test_error_messages(self):

        self.model.driver.clear_objectives()
        self.model.driver.clear_constraints()
        try:
            self.model.driver._check()
        except __HOLE__, err:
            msg = "driver: Missing outputs for gradient calculation"
            self.assertEqual(str(err), msg)
        else:
            self.fail('ValueError expected')

        self.model.driver.clear_parameters()
        try:
            self.model.driver._check()
        except ValueError, err:
            msg = "driver: Missing inputs for gradient calculation"
            self.assertEqual(str(err), msg)
        else:
            self.fail('ValueError expected')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/drivers/test/test_sensitivity.py/SensitivityDriverTestCase.test_error_messages