def _find_testsuite_files(path): if isinstance(path, str): path = Path(path) if path.is_file(): if path.name.endswith(suffix): paths = [path] else: LOGGER.warning(f"{path} is file, but not end with `{suffix}`, skip") paths = [] else: paths = path.glob(f"**/*{suffix}") return [p.resolve() for p in paths]
def _find_testsuite_files(path): suffix = ["testsuite.json", "benchmark.json"] if isinstance(path, str): path = Path(path) if path.is_file(): if path.name.endswith(suffix[0]) or path.name.endswith(suffix[1]): paths = [path] else: LOGGER.warning(f"{path} is file, but not end with `{suffix}`, skip") paths = [] return [p.resolve() for p in paths] else: os.path.abspath(path) paths = glob_.glob(f"{path}/*{suffix[0]}") + glob_.glob(f"{path}/*{suffix[1]}") return [Path(p) for p in paths]