Return ``[(name, helpers, code), ...]`` for *pytest.mark.parametrize*.
(md_path, mode)
| 69 | |
| 70 | |
| 71 | def 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 | |
| 91 | def get_server_code(md_path): |
no test coverage detected