File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed
Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -73,28 +73,10 @@ def path_does_not_exist(x: Path) -> bool | str:
7373 if not test_file .name .startswith ("test_" ):
7474 return "Test file must start with 'test_'"
7575
76- # if app path directory is the same as the test file directory, use `local_app`
77- # otherwise, use `create_app_fixture`
78- is_same_dir = app_file .parent == test_file .parent
79-
8076 test_name = test_file .name .replace (".py" , "" )
8177 rel_path = os .path .relpath (app_file , test_file .parent )
8278
83- template = (
84- f"""\
85- from playwright.sync_api import Page
86-
87- from shiny.playwright import controller
88- from shiny.run import ShinyAppProc
89-
90-
91- def { test_name } (page: Page, local_app: ShinyAppProc):
92-
93- page.goto(local_app.url)
94- # Add test code here
95- """
96- if is_same_dir
97- else f"""\
79+ template = f"""\
9880 from playwright.sync_api import Page
9981
10082from shiny.playwright import controller
@@ -109,7 +91,6 @@ def {test_name}(page: Page, app: ShinyAppProc):
10991 page.goto(app.url)
11092 # Add test code here
11193"""
112- )
11394 # Make sure test file directory exists
11495 test_file .parent .mkdir (parents = True , exist_ok = True )
11596
You can’t perform that action at this time.
0 commit comments