Skip to content

Commit

Permalink
Add tests for shiny_mode comment detection
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Mar 20, 2024
1 parent 00d956e commit 2f75a90
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/pytest/test_express.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ def write_tmp_file(s: str):

write_tmp_file("def f():\n import shiny.express")
assert not express.is_express_app(tmp_file, None)

# Look for magic comment - should override import detection
write_tmp_file("\n#shiny_mode: core\nfrom shiny.express import ui")
assert not express.is_express_app(tmp_file, None)

write_tmp_file("#shiny_mode: express\nfrom shiny import ui")
assert express.is_express_app(tmp_file, None)

0 comments on commit 2f75a90

Please sign in to comment.