CONPY-205: Added error constants

Error code constants are now defined in constants/ERR.
The file ERR.py is generated by helper/create_errconst.py
script, please don't edit it.
This commit is contained in:
Georg Richter
2022-05-25 18:54:11 +02:00
parent 30c8f33b08
commit f23e4e9b83
5 changed files with 1262 additions and 2 deletions

View File

@ -1278,6 +1278,15 @@ class TestCursor(unittest.TestCase):
cursor.close()
def test_conpy203(self):
conn= create_connection()
cursor= conn.cursor()
try:
cursor.execute("SELECT")
except mariadb.ProgrammingError as err:
self.assertEqual(err.errno, ERR.ER_PARSE_ERROR)
def test_conpy91(self):
with create_connection() as connection:
with connection.cursor() as cursor: