From 4fc59917284aac854c34392bd3075144c8a71a23 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 8 Oct 2018 12:16:27 +0800 Subject: [PATCH] update test for fake reader decorator --- python/paddle/reader/tests/decorator_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python/paddle/reader/tests/decorator_test.py b/python/paddle/reader/tests/decorator_test.py index cd585403fb1..e57f9cc29df 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__': -- GitLab