MCPcopy
hub / github.com/marimo-team/marimo / test_internal_api

Function test_internal_api

tests/_internal/test_internal_api.py:12–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def 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))

Callers

nothing calls this directly

Calls 7

explore_moduleFunction · 0.90
snapshotFunction · 0.85
is_fileMethod · 0.80
is_dirMethod · 0.80
iterdirMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…