From 1cefac93fa53e2830a97163e63044addbd88933f Mon Sep 17 00:00:00 2001 From: Bobholamovic Date: Tue, 19 Jul 2022 14:33:34 +0800 Subject: [PATCH] Exclude testing run_with_clean_log.py --- tests/test_tutorials.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 1c1543f..8d8c7f7 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -13,6 +13,7 @@ # limitations under the License. import os.path as osp +import re import tempfile import shutil from glob import iglob @@ -23,7 +24,7 @@ from testing_utils import run_script, CpuCommonTest class TestTutorial(CpuCommonTest): SUBDIR = "./" TIMEOUT = 300 - PATTERN = "*.py" + REGEX = ".*" @classmethod def setUpClass(cls): @@ -52,7 +53,9 @@ class TestTutorial(CpuCommonTest): return _test_tutorial_impl - for script_path in iglob(osp.join(cls.SUBDIR, cls.PATTERN)): + for script_path in filter( + re.compile(cls.REGEX).match, + iglob(osp.join(cls.SUBDIR, '*.py'))): script_name = osp.basename(script_path) if osp.normpath(osp.join(cls.SUBDIR, script_name)) != osp.normpath( script_path): @@ -82,3 +85,4 @@ class TestDetTutorial(TestTutorial): @TestTutorial.add_tests class TestSegTutorial(TestTutorial): SUBDIR = "../tutorials/train/semantic_segmentation" + REGEX = r".*(?