()
| 10 | |
| 11 | |
| 12 | def test_internal_api(): |
| 13 | # Get all Python files and folders in marimo/_internal |
| 14 | internal_path = ( |
| 15 | Path(__file__).parent.parent.parent / "marimo" / "_internal" |
| 16 | ) |
| 17 | |
| 18 | # Get both .py files and directories |
| 19 | items = [] |
| 20 | for item in sorted(internal_path.iterdir()): |
| 21 | if item.name.startswith("_"): |
| 22 | continue |
| 23 | if item.is_file() and item.suffix == ".py": |
| 24 | items.append((item.stem, False)) |
| 25 | elif item.is_dir(): |
| 26 | items.append((item.name, True)) |
| 27 | |
| 28 | all_results = [] |
| 29 | for name, _is_dir in items: |
| 30 | # Import the module dynamically |
| 31 | module_name = f"marimo._internal.{name}" |
| 32 | module = importlib.import_module(module_name) |
| 33 | |
| 34 | # Explore the module |
| 35 | results = explore_module(module) |
| 36 | if results: |
| 37 | all_results.append(name) |
| 38 | all_results.extend([f" {line}" for line in results]) |
| 39 | |
| 40 | assert len(all_results) > 0 |
| 41 | snapshot("internal_api.txt", "\n".join(all_results)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…