@testing.requires.independent_connections
def test_rollback_inactive(self):
    users = self.tables.users
    with testing.db.connect() as conn:
        conn.execute(users.insert(), {'user_id': 1, 'user_name': 'name'})
        conn.commit()
        conn.execute(users.insert(), {'user_id': 2, 'user_name': 'name2'})
        conn.invalidate()
        assert_raises_message(exc.PendingRollbackError, "Can't reconnect", conn.execute, select(1))
        conn.rollback()
        eq_(conn.scalar(select(func.count(1)).select_from(users)), 1)
@testing.requires.independent_connections
def test_rollback_inactive(self):
    users = self.tables.users
    with testing.db.connect() as conn:
        conn.execute(users.insert(), {'user_id': 1, 'user_name': 'name'})
        conn.commit()
        conn.execute(users.insert(), {'user_id': 2, 'user_name': 'name2'})
        conn.invalidate()
        assert_raises_message(exc.PendingRollbackError, "Can't reconnect", conn.execute, select(1))
        conn.rollback()
        eq_(conn.scalar(select(func.count(1)).select_from(users)), 1)