test(sequence): Use mariadb client's exception handling
This commit is contained in:
parent
a03bf6b0bb
commit
ca0016a996
1 changed files with 2 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import psycopg2
|
||||
import pymysql
|
||||
|
||||
import frappe
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
|
@ -35,10 +34,10 @@ class TestSequence(FrappeTestCase):
|
|||
|
||||
try:
|
||||
frappe.db.get_next_sequence_val(seq_name)
|
||||
except pymysql.err.OperationalError as e:
|
||||
self.assertEqual(e.args[0], 4084)
|
||||
except psycopg2.errors.SequenceGeneratorLimitExceeded:
|
||||
pass
|
||||
except frappe.db.ProgrammingError as e:
|
||||
self.assertEqual(getattr(e, "errno", None), 4084)
|
||||
else:
|
||||
self.fail("NEXTVAL didn't raise any error upon sequence's end")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue