提交 4fc59917 编写于 作者: Q qiaolongfei

update test for fake reader decorator

上级 bda05dc3
...@@ -211,11 +211,12 @@ class TestFakeReader(unittest.TestCase): ...@@ -211,11 +211,12 @@ class TestFakeReader(unittest.TestCase):
data_num = 100 data_num = 100
fake_reader = paddle.reader.fake(reader, data_num) fake_reader = paddle.reader.fake(reader, data_num)
i = 0 for _ in range(10):
for data in fake_reader(): i = 0
self.assertEqual(data, 0) for data in fake_reader():
i += 1 self.assertEqual(data, 0)
self.assertEqual(i, data_num) i += 1
self.assertEqual(i, data_num)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册