Skip to content

Commit 53cf486

Browse files
committed
Update test template to use create_app_fixture
Replaces the use of 'local_app' with 'app' and utilizes 'create_app_fixture' from shiny.pytest for test setup. This improves consistency and aligns with updated testing practices.
1 parent d656fdb commit 53cf486

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

shiny/_main_add_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ def path_does_not_exist(x: Path) -> bool | str:
8585
from playwright.sync_api import Page
8686
8787
from shiny.playwright import controller
88+
from shiny.pytest import create_app_fixture
8889
from shiny.run import ShinyAppProc
8990
91+
app = create_app_fixture("{app_file.name}")
92+
9093
91-
def {test_name}(page: Page, local_app: ShinyAppProc):
94+
def {test_name}(page: Page, app: ShinyAppProc):
9295
93-
page.goto(local_app.url)
96+
page.goto(app.url)
9497
# Add test code here
9598
"""
9699
if is_same_dir

0 commit comments

Comments
 (0)