@@ -126,12 +126,12 @@ def session(
126126 client = LaunchableClient (app = app , tracking_client = tracking_client )
127127
128128 if session :
129- sub_path = "builds/{}/test_sessions/{}" . format ( build_name , session )
129+ sub_path = f "builds/{ build_name } /test_sessions/{ session } "
130130 try :
131131 res = client .request ("get" , sub_path )
132132
133133 if res .status_code != 404 :
134- msg = "This session name ({}) is already used. Please set another name." . format ( session )
134+ msg = f "This session name ({ session } ) is already used. Please set another name."
135135 typer .secho (msg , fg = typer .colors .RED , err = True )
136136 tracking_client .send_error_event (
137137 event_name = Tracking .ErrorEvent .USER_ERROR ,
@@ -165,13 +165,12 @@ def session(
165165 payload ["links" ] = _links
166166
167167 try :
168- sub_path = "builds/{}/test_sessions" . format ( build_name )
168+ sub_path = f "builds/{ build_name } /test_sessions"
169169 res = client .request ("post" , sub_path , payload = payload )
170170
171171 if res .status_code == HTTPStatus .NOT_FOUND :
172- msg = "Build {} was not found." \
173- "Make sure to run `launchable record build --build {}` before you run this command." .format (
174- build_name , build_name )
172+ msg = f"Build { build_name } was not found." \
173+ f"Make sure to run `launchable record build --build { build_name } ` before you run this command."
175174 tracking_client .send_error_event (
176175 event_name = Tracking .ErrorEvent .INTERNAL_CLI_ERROR ,
177176 stack_trace = msg ,
@@ -185,15 +184,15 @@ def session(
185184 if is_no_build :
186185 build_name = res .json ().get ("buildNumber" , "" )
187186 assert build_name is not None
188- sub_path = "builds/{}/test_sessions" . format ( build_name )
187+ sub_path = f "builds/{ build_name } /test_sessions"
189188
190189 if print_session :
191190 # what we print here gets captured and passed to `--session` in
192191 # later commands
193- typer .echo ("{ }/{}" . format ( sub_path , session_id ) , nl = False )
192+ typer .echo (f" { sub_path } /{ session_id } " , nl = False )
194193
195194 # Return the session ID for use by calling functions
196- return "{ }/{}" . format ( sub_path , session_id )
195+ return f" { sub_path } /{ session_id } "
197196
198197 except Exception as e :
199198 tracking_client .send_error_event (
@@ -226,22 +225,22 @@ def add_session_name(
226225 session_id : str ,
227226 session_name : str ,
228227):
229- sub_path = "builds/{}/test_sessions/{}" . format ( build_name , session_id )
228+ sub_path = f "builds/{ build_name } /test_sessions/{ session_id } "
230229 payload = {
231230 "name" : session_name
232231 }
233232 res = client .request ("patch" , sub_path , payload = payload )
234233
235234 if res .status_code == HTTPStatus .NOT_FOUND :
236235 typer .secho (
237- "Test session {} was not found. Record session may have failed." . format ( session_id ) ,
236+ f "Test session { session_id } was not found. Record session may have failed." ,
238237 fg = typer .colors .YELLOW , err = True
239238 )
240239 sys .exit (1 )
241240 if res .status_code == HTTPStatus .BAD_REQUEST :
242241 typer .secho (
243242 "You cannot use test session name {} since it is already used by other test session in your workspace. "
244- "The record session is completed successfully without session name." . format ( session_name ) ,
243+ "The record session is completed successfully without session name." ,
245244 fg = typer .colors .YELLOW , err = True )
246245 sys .exit (1 )
247246
0 commit comments