From b8ba35bd27209c01ba3bca978da6570a428d78e5 Mon Sep 17 00:00:00 2001 From: "feiwu.yfw" Date: Wed, 22 Jun 2022 22:01:25 +0800 Subject: [PATCH] [to #42670107] restore pydataset test * pydataset unitest Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9132896 --- modelscope/utils/registry.py | 2 +- tests/pipelines/test_image_matting.py | 2 +- tests/pydatasets/test_py_dataset.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modelscope/utils/registry.py b/modelscope/utils/registry.py index b26b899d..8009b084 100644 --- a/modelscope/utils/registry.py +++ b/modelscope/utils/registry.py @@ -78,7 +78,7 @@ class Registry(object): f'{self._name}[{default_group}] and will ' 'be overwritten') logger.warning(f'{self._modules[default_group][module_name]}' - 'to {module_cls}') + f'to {module_cls}') # also register module in the default group for faster access # only by module name self._modules[default_group][module_name] = module_cls diff --git a/tests/pipelines/test_image_matting.py b/tests/pipelines/test_image_matting.py index 23ea678b..751b6975 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() >= 2, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 1, '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/pydatasets/test_py_dataset.py b/tests/pydatasets/test_py_dataset.py index bc38e369..4ad767fa 100644 --- a/tests/pydatasets/test_py_dataset.py +++ b/tests/pydatasets/test_py_dataset.py @@ -33,8 +33,6 @@ class ImgPreprocessor(Preprocessor): class PyDatasetTest(unittest.TestCase): - @unittest.skipUnless(test_level() >= 2, - 'skip test due to dataset api problem') def test_ds_basic(self): ms_ds_full = PyDataset.load('squad') ms_ds_full_hf = hfdata.load_dataset('squad')