From 5a4ff8cfdb10f6d5ddcc4da87fe3efb8df0b3442 Mon Sep 17 00:00:00 2001 From: liyong Date: Sat, 28 Aug 2021 11:03:18 +0800 Subject: [PATCH] fix ci issue --- tests/ut/python/dataset/test_minddataset_exception.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/ut/python/dataset/test_minddataset_exception.py b/tests/ut/python/dataset/test_minddataset_exception.py index 79c2b09851..d7b676f0dc 100644 --- a/tests/ut/python/dataset/test_minddataset_exception.py +++ b/tests/ut/python/dataset/test_minddataset_exception.py @@ -97,16 +97,9 @@ def test_invalid_mindrecord(): num_readers = 4 with pytest.raises(RuntimeError, match="Unexpected error. Invalid file content. path:"): data_set = ds.MindDataset('dummy.mindrecord', columns_list, num_readers) - num_iter = 0 for _ in data_set.create_dict_iterator(num_epochs=1, output_numpy=True): - num_iter += 1 - try: - assert num_iter == 0 - except Exception as error: - os.remove('dummy.mindrecord') - raise error - else: - os.remove('dummy.mindrecord') + pass + os.remove('dummy.mindrecord') def test_minddataset_lack_db():