def _test_db(self):
@db_connection
def get_test_value():
return 1325 # misc value, the decorator will return None on failure
test_value = None
try:
test_value = get_test_value()
except OperationalError as exc:
print("Exception caught: " + str(exc))
if test_value is not None:
print("Database access test OK")
else:
print("Database access test failed :(")
评论列表
文章目录