MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / run_doctest

Function run_doctest

tools/sampcd_processor_utils.py:798–827  ·  view source on GitHub ↗
(args, doctester: DocTester)

Source from the content-addressed store, hash-verified

796
797
798def run_doctest(args, doctester: DocTester):
799 # init logger
800 init_logger(debug=args.debug, log_file=args.logf)
801
802 logger.info("----------------Codeblock Check Start--------------------")
803
804 logger.info(">>> Check test mode ...")
805 run_on_device = check_test_mode(mode=args.mode, gpu_id=args.gpu_id)
806
807 logger.info(">>> Get test capacity ...")
808 sample_code_test_capacity = get_test_capacity(run_on_device)
809
810 logger.info(">>> Get docstring from api ...")
811 docstrings_to_test, whl_error = get_docstring(full_test=args.full_test)
812
813 logger.info(">>> Checking plain sample code style before Paddle 2.5 ...")
814 check_old_style(docstrings_to_test)
815
816 logger.info(">>> Prepare doctester ...")
817 doctester.prepare(sample_code_test_capacity)
818
819 logger.info(">>> Running doctester ...")
820 test_results = get_test_results(doctester, docstrings_to_test)
821
822 logger.info(">>> Print summary ...")
823 doctester.print_summary(test_results, whl_error)
824
825 if args.mode == "cpu":
826 # As cpu mode is also run with the GPU whl, so skip it in gpu mode.
827 exec_gen_doc()
828
829
830def parse_args():

Callers 1

Calls 10

init_loggerFunction · 0.85
check_test_modeFunction · 0.85
get_test_capacityFunction · 0.85
check_old_styleFunction · 0.85
exec_gen_docFunction · 0.85
get_docstringFunction · 0.70
get_test_resultsFunction · 0.70
infoMethod · 0.45
prepareMethod · 0.45
print_summaryMethod · 0.45

Tested by

no test coverage detected