Skip to content

Commit 911c044

Browse files
committed
Add test
1 parent 5ca6521 commit 911c044

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

panel/tests/test_imports.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,34 @@ def test_no_blocklist_imports():
1919
output = check_output([sys.executable, '-c', dedent(check)])
2020

2121
assert output == b""
22+
23+
24+
def test_limited_panel_imports():
25+
check = """\
26+
import sys
27+
import panel
28+
29+
found = sorted([k for k in sys.modules if k.startswith("panel")])
30+
31+
expected = [
32+
"panel",
33+
"panel.__version",
34+
"panel._version",
35+
"panel.config",
36+
"panel.depends",
37+
"panel.io",
38+
"panel.io.logging",
39+
"panel.io.state",
40+
"panel.util",
41+
"panel.util.checks",
42+
"panel.util.parameters",
43+
]
44+
45+
if found != expected:
46+
mods = set(found) - set(expected)
47+
print(", ".join(mods), end="")
48+
"""
49+
50+
output = check_output([sys.executable, '-c', dedent(check)])
51+
52+
assert output == b""

0 commit comments

Comments
 (0)