@@ -130,12 +130,12 @@ def session(
130130 client = LaunchableClient (app = app , tracking_client = tracking_client )
131131
132132 if session :
133- sub_path = "builds/{}/test_sessions/{}" . format ( build_name , session )
133+ sub_path = f "builds/{ build_name } /test_sessions/{ session } "
134134 try :
135135 res = client .request ("get" , sub_path )
136136
137137 if res .status_code != 404 :
138- msg = "This session name ({}) is already used. Please set another name." . format ( session )
138+ msg = f "This session name ({ session } ) is already used. Please set another name."
139139 typer .secho (msg , fg = typer .colors .RED , err = True )
140140 tracking_client .send_error_event (
141141 event_name = Tracking .ErrorEvent .USER_ERROR ,
@@ -170,13 +170,12 @@ def session(
170170 payload ["links" ] = _links
171171
172172 try :
173- sub_path = "builds/{}/test_sessions" . format ( build_name )
173+ sub_path = f "builds/{ build_name } /test_sessions"
174174 res = client .request ("post" , sub_path , payload = payload )
175175
176176 if res .status_code == HTTPStatus .NOT_FOUND :
177- msg = "Build {} was not found." \
178- "Make sure to run `launchable record build --build {}` before you run this command." .format (
179- build_name , build_name )
177+ msg = f"Build { build_name } was not found." \
178+ f"Make sure to run `launchable record build --build { build_name } ` before you run this command."
180179 tracking_client .send_error_event (
181180 event_name = Tracking .ErrorEvent .INTERNAL_CLI_ERROR ,
182181 stack_trace = msg ,
@@ -190,15 +189,15 @@ def session(
190189 if is_no_build :
191190 build_name = res .json ().get ("buildNumber" , "" )
192191 assert build_name is not None
193- sub_path = "builds/{}/test_sessions" . format ( build_name )
192+ sub_path = f "builds/{ build_name } /test_sessions"
194193
195194 if print_session :
196195 # what we print here gets captured and passed to `--session` in
197196 # later commands
198- typer .echo ("{ }/{}" . format ( sub_path , session_id ) , nl = False )
197+ typer .echo (f" { sub_path } /{ session_id } " , nl = False )
199198
200199 # Return the session ID for use by calling functions
201- return "{ }/{}" . format ( sub_path , session_id )
200+ return f" { sub_path } /{ session_id } "
202201
203202 except Exception as e :
204203 tracking_client .send_error_event (
@@ -231,22 +230,22 @@ def add_session_name(
231230 session_id : str ,
232231 session_name : str ,
233232):
234- sub_path = "builds/{}/test_sessions/{}" . format ( build_name , session_id )
233+ sub_path = f "builds/{ build_name } /test_sessions/{ session_id } "
235234 payload = {
236235 "name" : session_name
237236 }
238237 res = client .request ("patch" , sub_path , payload = payload )
239238
240239 if res .status_code == HTTPStatus .NOT_FOUND :
241240 typer .secho (
242- "Test session {} was not found. Record session may have failed." . format ( session_id ) ,
241+ f "Test session { session_id } was not found. Record session may have failed." ,
243242 fg = typer .colors .YELLOW , err = True
244243 )
245244 sys .exit (1 )
246245 if res .status_code == HTTPStatus .BAD_REQUEST :
247246 typer .secho (
248247 "You cannot use test session name {} since it is already used by other test session in your workspace. "
249- "The record session is completed successfully without session name." . format ( session_name ) ,
248+ "The record session is completed successfully without session name." ,
250249 fg = typer .colors .YELLOW , err = True )
251250 sys .exit (1 )
252251
0 commit comments