def test_cursor_shutdown_in_initialize(self): db = self._fixture(True, True) assert_raises_message_context_ok(exc.SAWarning, "Exception attempting to detect", db.connect) eq_( db.pool.logger.error.mock_calls, [call("Error closing cursor", exc_info=True)], )
def test_raise_db_is_stopped(self): pool = self._pool_fixture(pre_ping=True) conn = pool.connect() conn.close() self.dbapi.shutdown("execute", stop=True) assert_raises_message_context_ok(MockDisconnect, "database is stopped", pool.connect)