(tests_path: Text)
make testcase(s) with testcase/testsuite/folder absolute path
        generated pytest file path will be cached in pytest_files_made_cache_mapping

    Args:
        tests_path: should be in absolute path
make testcase(s) with testcase/testsuite/folder absolute path
        generated pytest file path will be cached in pytest_files_made_cache_mapping
make testcase ( s ) with testcase / testsuite / folder absolute path generated pytest file path will be cached in pytest_files_made_cache_mapping
def __make(tests_path: Text) -> NoReturn:
    """ make testcase(s) with testcase/testsuite/folder absolute path
        generated pytest file path will be cached in pytest_files_made_cache_mapping

    Args:
        tests_path: should be in absolute path

    """
    logger.info(f"make path: {tests_path}")
    test_files = []
    if os.path.isdir(tests_path):
        files_list = load_folder_files(tests_path)
        test_files.extend(files_list)
    elif os.path.isfile(tests_path):
        test_files.append(tests_path)
    else:
        raise exceptions.TestcaseNotFound(f"Invalid tests path: {tests_path}")

    for test_file in test_files:
        if test_file.lower().endswith("_test.py"):
            pytest_files_run_set.add(test_file)
            continue

        try:
            test_content = load_test_file(test_file)
        except (exceptions.FileNotFound, exceptions.FileFormatError) as ex:
            logger.warning(f"Invalid test file: {test_file}\n{type(ex).__name__}: {ex}")
            continue

        if not isinstance(test_content, Dict):
            logger.warning(
                f"Invalid test file: {test_file}\n"
                f"reason: test content not in dict format."
            )
            continue

        # api in v2 format, convert to v3 testcase
        if "request" in test_content and "name" in test_content:
            test_content = ensure_testcase_v3_api(test_content)

        if "config" not in test_content:
            logger.warning(
                f"Invalid testcase/testsuite file: {test_file}\n"
                f"reason: missing config part."
            )
            continue
        elif not isinstance(test_content["config"], Dict):
            logger.warning(
                f"Invalid testcase/testsuite file: {test_file}\n"
                f"reason: config should be dict type, got {test_content['config']}"
            )
            continue

        # ensure path absolute
        test_content.setdefault("config", {})["path"] = test_file

        # testcase
        if "teststeps" in test_content:
            try:
                testcase_pytest_path = make_testcase(test_content)
                pytest_files_run_set.add(testcase_pytest_path)
            except exceptions.TestCaseFormatError as ex:
                logger.warning(
                    f"Invalid testcase file: {test_file}\n{type(ex).__name__}: {ex}"
                )
                continue

        # testsuite
        elif "testcases" in test_content:
            try:
                make_testsuite(test_content)
            except exceptions.TestSuiteFormatError as ex:
                logger.warning(
                    f"Invalid testsuite file: {test_file}\n{type(ex).__name__}: {ex}"
                )
                continue

        # invalid format
        else:
            logger.warning(
                f"Invalid test file: {test_file}\n"
                f"reason: file content is neither testcase nor testsuite"
            )
def __make ( tests_path : Text ) -> NoReturn : logger . info ( f"make path: {tests_path}" ) test_files = [ ] if os . path . isdir ( tests_path ) : files_list = load_folder_files ( tests_path ) test_files . extend ( files_list ) elif os . path . isfile ( tests_path ) : test_files . append ( tests_path ) else : raise exceptions . TestcaseNotFound ( f"Invalid tests path: {tests_path}" ) for test_file in test_files : if test_file . lower ( ) . endswith ( "_test.py" ) : pytest_files_run_set . add ( test_file ) continue try : test_content = load_test_file ( test_file ) except ( exceptions . FileNotFound , exceptions . FileFormatError ) as ex : logger . warning ( f"Invalid test file: {test_file}\n{type(ex).__name__}: {ex}" ) continue if not isinstance ( test_content , Dict ) : logger . warning ( f"Invalid test file: {test_file}\n" f"reason: test content not in dict format." ) continue # api in v2 format, convert to v3 testcase if "request" in test_content and "name" in test_content : test_content = ensure_testcase_v3_api ( test_content ) if "config" not in test_content : logger . warning ( f"Invalid testcase/testsuite file: {test_file}\n" f"reason: missing config part." ) continue elif not isinstance ( test_content [ "config" ] , Dict ) : logger . warning ( f"Invalid testcase/testsuite file: {test_file}\n" f"reason: config should be dict type, got {test_content['config']}" ) continue # ensure path absolute test_content . setdefault ( "config" , { } ) [ "path" ] = test_file # testcase if "teststeps" in test_content : try : testcase_pytest_path = make_testcase ( test_content ) pytest_files_run_set . add ( testcase_pytest_path ) except exceptions . TestCaseFormatError as ex : logger . warning ( f"Invalid testcase file: {test_file}\n{type(ex).__name__}: {ex}" ) continue # testsuite elif "testcases" in test_content : try : make_testsuite ( test_content ) except exceptions . TestSuiteFormatError as ex : logger . warning ( f"Invalid testsuite file: {test_file}\n{type(ex).__name__}: {ex}" ) continue # invalid format else : logger . warning ( f"Invalid test file: {test_file}\n" f"reason: file content is neither testcase nor testsuite" )