MCPcopy
hub / github.com/VibiumDev/vibium / get_tutorial_tests

Function get_tutorial_tests

tests/py/helpers/tutorial_runner.py:71–88  ·  view source on GitHub ↗

Return ``[(name, helpers, code), ...]`` for *pytest.mark.parametrize*.

(md_path, mode)

Source from the content-addressed store, hash-verified

69
70
71def get_tutorial_tests(md_path, mode):
72 """Return ``[(name, helpers, code), ...]`` for *pytest.mark.parametrize*."""
73 blocks = extract_blocks(md_path)
74 helpers = ""
75 tests = []
76
77 # Collect all helpers first (they may appear anywhere in the file)
78 for block in blocks:
79 if block["type"] == "helpers":
80 helpers += block["code"] + "\n"
81
82 for block in blocks:
83 if block.get("mode") != mode:
84 continue
85 if block["type"] == "test":
86 tests.append((block["name"], helpers, block["code"]))
87
88 return tests
89
90
91def get_server_code(md_path):

Calls 2

extract_blocksFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected