Skip to content

Commit 8dea6ad

Browse files
authored
test: remove exception swallower to make debug easier (#1328)
1 parent 772b3f3 commit 8dea6ad

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

tests/playwright/utils/deploy_utils.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@ def skip_if_not_chrome(fn: CallableT) -> CallableT:
4545
return fn
4646

4747

48-
def exception_swallower(
49-
function: Callable[[str, str], str]
50-
) -> Callable[[str, str], str]:
51-
def wrapper(app_name: str, app_dir: str) -> str:
52-
runtime_e: Exception | None = None
53-
try:
54-
return function(app_name, app_dir)
55-
except Exception as e:
56-
runtime_e = e
57-
if isinstance(runtime_e, Exception):
58-
raise RuntimeError("Failed to deploy to server.")
59-
60-
return wrapper
61-
62-
6348
def run_command(cmd: str) -> str:
6449
output = subprocess.run(
6550
cmd,
@@ -104,9 +89,6 @@ def deploy_to_connect(app_name: str, app_dir: str) -> str:
10489
return url
10590

10691

107-
quiet_deploy_to_connect = exception_swallower(deploy_to_connect)
108-
109-
11092
# TODO-future: Supress web browser from opening after deploying - https://github.com/rstudio/rsconnect-python/issues/462
11193
def deploy_to_shinyapps(app_name: str, app_dir: str) -> str:
11294
# Deploy to shinyapps.io
@@ -115,9 +97,6 @@ def deploy_to_shinyapps(app_name: str, app_dir: str) -> str:
11597
return f"https://{name}.shinyapps.io/{app_name}/"
11698

11799

118-
quiet_deploy_to_shinyapps = exception_swallower(deploy_to_shinyapps)
119-
120-
121100
# Since connect parses python packages, we need to get latest version of shiny on HEAD
122101
def write_requirements_txt(app_dir: str) -> None:
123102
app_requirements_file_path = os.path.join(app_dir, "app_requirements.txt")
@@ -173,8 +152,8 @@ def deploy_app(
173152
write_requirements_txt(tmp_app_dir)
174153

175154
deployment_function = {
176-
"connect": quiet_deploy_to_connect,
177-
"shinyapps": quiet_deploy_to_shinyapps,
155+
"connect": deploy_to_connect,
156+
"shinyapps": deploy_to_shinyapps,
178157
}[location]
179158

180159
pre_deployment_time = time.time()

0 commit comments

Comments
 (0)