本文整理汇总了Python中sqlite3.Warning方法的典型用法代码示例。如果您正苦于以下问题:Python sqlite3.Warning方法的具体用法?Python sqlite3.Warning怎么用?Python sqlite3.Warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlite3
的用法示例。
在下文中一共展示了sqlite3.Warning方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CheckWarning
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckWarning(self):
self.assertTrue(issubclass(sqlite.Warning, StandardError),
"Warning is not a subclass of StandardError")
示例2: CheckExceptions
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckExceptions(self):
# Optional DB-API extension.
self.assertEqual(self.cx.Warning, sqlite.Warning)
self.assertEqual(self.cx.Error, sqlite.Error)
self.assertEqual(self.cx.InterfaceError, sqlite.InterfaceError)
self.assertEqual(self.cx.DatabaseError, sqlite.DatabaseError)
self.assertEqual(self.cx.DataError, sqlite.DataError)
self.assertEqual(self.cx.OperationalError, sqlite.OperationalError)
self.assertEqual(self.cx.IntegrityError, sqlite.IntegrityError)
self.assertEqual(self.cx.InternalError, sqlite.InternalError)
self.assertEqual(self.cx.ProgrammingError, sqlite.ProgrammingError)
self.assertEqual(self.cx.NotSupportedError, sqlite.NotSupportedError)
示例3: CheckExecuteTooMuchSql
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckExecuteTooMuchSql(self):
try:
self.cu.execute("select 5+4; select 4+5")
self.fail("should have raised a Warning")
except sqlite.Warning:
return
except:
self.fail("raised wrong exception")
示例4: CheckConnectionCall
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckConnectionCall(self):
"""
Call a connection with a non-string SQL request: check error handling
of the statement constructor.
"""
self.assertRaises(sqlite.Warning, self.con, 1)
示例5: CheckWarning
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckWarning(self):
self.assertTrue(issubclass(sqlite.Warning, Exception),
"Warning is not a subclass of Exception")
示例6: CheckExecuteTooMuchSql
# 需要导入模块: import sqlite3 [as 别名]
# 或者: from sqlite3 import Warning [as 别名]
def CheckExecuteTooMuchSql(self):
with self.assertRaises(sqlite.Warning):
self.cu.execute("select 5+4; select 4+5")