Skip to content

Commit 2f75a90

Browse files
committed
Add tests for shiny_mode comment detection
1 parent 00d956e commit 2f75a90

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/pytest/test_express.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ def write_tmp_file(s: str):
4444

4545
write_tmp_file("def f():\n import shiny.express")
4646
assert not express.is_express_app(tmp_file, None)
47+
48+
# Look for magic comment - should override import detection
49+
write_tmp_file("\n#shiny_mode: core\nfrom shiny.express import ui")
50+
assert not express.is_express_app(tmp_file, None)
51+
52+
write_tmp_file("#shiny_mode: express\nfrom shiny import ui")
53+
assert express.is_express_app(tmp_file, None)

0 commit comments

Comments
 (0)