From e7571a566f46938dfbba89d1e12e3d033f0e9448 Mon Sep 17 00:00:00 2001 From: "yingda.chen" Date: Fri, 24 Jun 2022 11:47:28 +0800 Subject: [PATCH] [to #42322933] skip dataset test for now Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9155405 --- tests/pipelines/test_image_matting.py | 2 +- tests/pipelines/test_text_classification.py | 2 +- tests/pydatasets/test_py_dataset.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pipelines/test_image_matting.py b/tests/pipelines/test_image_matting.py index f7838d5e..1b547e14 100644 --- a/tests/pipelines/test_image_matting.py +++ b/tests/pipelines/test_image_matting.py @@ -60,7 +60,7 @@ class ImageMattingTest(unittest.TestCase): cv2.imwrite('result.png', result['output_png']) print(f'Output written to {osp.abspath("result.png")}') - @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_run_with_modelscope_dataset(self): dataset = PyDataset.load('beans', split='train', target='image') img_matting = pipeline(Tasks.image_matting, model=self.model_id) diff --git a/tests/pipelines/test_text_classification.py b/tests/pipelines/test_text_classification.py index 3c66d3e6..9e5f15b9 100644 --- a/tests/pipelines/test_text_classification.py +++ b/tests/pipelines/test_text_classification.py @@ -87,7 +87,7 @@ class SequenceClassificationTest(unittest.TestCase): result = text_classification(dataset) self.printDataset(result) - @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_run_with_modelscope_dataset(self): text_classification = pipeline(task=Tasks.text_classification) # loaded from modelscope dataset diff --git a/tests/pydatasets/test_py_dataset.py b/tests/pydatasets/test_py_dataset.py index 9cefe003..e84f240a 100644 --- a/tests/pydatasets/test_py_dataset.py +++ b/tests/pydatasets/test_py_dataset.py @@ -33,7 +33,7 @@ class ImgPreprocessor(Preprocessor): class PyDatasetTest(unittest.TestCase): - @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_ds_basic(self): ms_ds_full = PyDataset.load('squad') ms_ds_full_hf = hfdata.load_dataset('squad') @@ -49,7 +49,7 @@ class PyDatasetTest(unittest.TestCase): print(next(iter(ms_ds_train))) print(next(iter(ms_image_train))) - @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') @require_torch def test_to_torch_dataset_text(self): model_id = 'damo/bert-base-sst2' @@ -64,7 +64,7 @@ class PyDatasetTest(unittest.TestCase): dataloader = torch.utils.data.DataLoader(pt_dataset, batch_size=5) print(next(iter(dataloader))) - @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') @require_tf def test_to_tf_dataset_text(self): import tensorflow as tf