diff --git a/python/paddle/reader/tests/decorator_test.py b/python/paddle/reader/tests/decorator_test.py index cd585403fb15103a3e49380e7f8f0be325e73481..e57f9cc29dfe8cf925a418ee26d57afe4746b195 100644 --- a/python/paddle/reader/tests/decorator_test.py +++ b/python/paddle/reader/tests/decorator_test.py @@ -211,11 +211,12 @@ class TestFakeReader(unittest.TestCase): data_num = 100 fake_reader = paddle.reader.fake(reader, data_num) - i = 0 - for data in fake_reader(): - self.assertEqual(data, 0) - i += 1 - self.assertEqual(i, data_num) + for _ in range(10): + i = 0 + for data in fake_reader(): + self.assertEqual(data, 0) + i += 1 + self.assertEqual(i, data_num) if __name__ == '__main__':