Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Aug 30, 2024
1 parent 5ca6521 commit 911c044
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions panel/tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,34 @@ def test_no_blocklist_imports():
output = check_output([sys.executable, '-c', dedent(check)])

assert output == b""


def test_limited_panel_imports():
check = """\
import sys
import panel
found = sorted([k for k in sys.modules if k.startswith("panel")])
expected = [
"panel",
"panel.__version",
"panel._version",
"panel.config",
"panel.depends",
"panel.io",
"panel.io.logging",
"panel.io.state",
"panel.util",
"panel.util.checks",
"panel.util.parameters",
]
if found != expected:
mods = set(found) - set(expected)
print(", ".join(mods), end="")
"""

output = check_output([sys.executable, '-c', dedent(check)])

assert output == b""

0 comments on commit 911c044

Please sign in to comment.