def test_cursor_is_iterator(self):
        """Test that the cursor is an iterator"""
        conn = self.test_connection
        cursor = conn.cursor()
        cursor.execute("select * from test")
        self.assertEqual(cursor.__iter__(), cursor)
        self.assertEqual(cursor.__next__(), ("row1",))
Test that the cursor is an iterator
pymysql/tests/test_cursor.py