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:
73
73
if not test_file .name .startswith ("test_" ):
74
74
return "Test file must start with 'test_'"
75
75
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
-
80
76
test_name = test_file .name .replace (".py" , "" )
81
77
rel_path = os .path .relpath (app_file , test_file .parent )
82
78
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"""\
98
80
from playwright.sync_api import Page
99
81
100
82
from shiny.playwright import controller
@@ -109,7 +91,6 @@ def {test_name}(page: Page, app: ShinyAppProc):
109
91
page.goto(app.url)
110
92
# Add test code here
111
93
"""
112
- )
113
94
# Make sure test file directory exists
114
95
test_file .parent .mkdir (parents = True , exist_ok = True )
115
96
You can’t perform that action at this time.
0 commit comments