Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test():
cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertRaises(pyodbc.ProgrammingError, test)
def test_context_manager(self):
with pyodbc.connect(self.connection_string) as cnxn:
cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
# The connection should be closed now.
def test():
cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertRaises(pyodbc.ProgrammingError, test)
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, int))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, int))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, long)))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, long)))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, long)))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, long)))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, long)))
def test_getinfo_int(self):
value = self.cnxn.getinfo(pyodbc.SQL_DEFAULT_TXN_ISOLATION)
self.assertTrue(isinstance(value, (int, int)))