def METHOD_NAME(self):
    with self.assertRaises(OperationalError) as e:
        with Cursor(host='foohost', user='weewx1', passwd='weewx1') as e:
            pass
    self.assertEqual(get_error(e), 2005)