@@ -95,9 +95,9 @@ def test_handlers_called(mock_server, mocker):
9595
9696 with open (path_to_test_resource ("ch.wav" ), "rb" ) as audio_stream :
9797 ws_client .run_synchronously (
98- transcription_config = transcription_config ,
99- stream = audio_stream ,
100- audio_settings = audio_settings
98+ transcription_config = transcription_config ,
99+ stream = audio_stream ,
100+ audio_settings = audio_settings ,
101101 )
102102 mock_server .wait_for_clean_disconnects ()
103103
@@ -142,7 +142,7 @@ def language_changing_middleware(msg, is_binary):
142142 transcription_config = transcription_config ,
143143 stream = audio_stream ,
144144 audio_settings = audio_settings ,
145- )
145+ )
146146 mock_server .wait_for_clean_disconnects ()
147147
148148 # Each handler should have been called once for every message
@@ -181,7 +181,7 @@ def session_ender(event):
181181 transcription_config = transcription_config ,
182182 stream = audio_stream ,
183183 audio_settings = audio_settings ,
184- )
184+ )
185185 mock_server .wait_for_clean_disconnects ()
186186
187187 # Only one message should have been sent from the server
@@ -208,7 +208,7 @@ def test_run_synchronously_with_timeout(mock_server):
208208 transcription_config = transcription_config ,
209209 stream = audio_stream ,
210210 audio_settings = audio_settings ,
211- timeout = 0.0001 ,
211+ timeout = 0.0001 ,
212212 )
213213
214214
@@ -269,7 +269,7 @@ def session_ender(event, _):
269269 transcription_config = transcription_config ,
270270 stream = audio_stream ,
271271 audio_settings = audio_settings ,
272- )
272+ )
273273 mock_server .wait_for_clean_disconnects ()
274274
275275 assert len (mock_server .messages_received ) == expect_received_count
@@ -293,7 +293,7 @@ def config_updater(msg): # pylint: disable=unused-argument
293293 transcription_config = transcription_config ,
294294 stream = audio_stream ,
295295 audio_settings = audio_settings ,
296- )
296+ )
297297 mock_server .wait_for_clean_disconnects ()
298298
299299 set_recognition_config_msgs = mock_server .find_messages_by_type (
@@ -320,7 +320,7 @@ def test_start_recognition_sends_speaker_diarization_config(mock_server):
320320 transcription_config = transcription_config ,
321321 stream = audio_stream ,
322322 audio_settings = audio_settings ,
323- )
323+ )
324324 mock_server .wait_for_clean_disconnects ()
325325
326326 start_recognition_msgs = mock_server .find_messages_by_type ("StartRecognition" )
@@ -363,7 +363,7 @@ def stopper(msg): # pylint: disable=unused-argument
363363 transcription_config = transcription_config ,
364364 stream = audio_stream ,
365365 audio_settings = audio_settings ,
366- )
366+ )
367367 mock_server .wait_for_clean_disconnects ()
368368
369369 num_messages_after_stop = len (mock_server .messages_received )
@@ -391,9 +391,9 @@ async def mock_connect(*_, **__):
391391 with patch .object (client .LOGGER , "error" , mock_logger_error_method ):
392392 try :
393393 ws_client .run_synchronously (
394- transcription_config = TranscriptionConfig (language = "en" ),
395- stream = MagicMock (),
396- audio_settings = MagicMock (),
394+ transcription_config = TranscriptionConfig (language = "en" ),
395+ stream = MagicMock (),
396+ audio_settings = MagicMock (),
397397 )
398398 except ConnectionResetError as exc :
399399 assert exc is not None
@@ -511,13 +511,20 @@ async def test__producer_happy_path(mocker):
511511 if index < exp_iters - 1 :
512512 assert msg == index # from range in mock_read_in_chunks
513513 exp_current_seq_no += 1
514- cmp_dicts (original_state , state , exp_diffs = {"seq_no" : {"single" : exp_current_seq_no }})
514+ cmp_dicts (
515+ original_state ,
516+ state ,
517+ exp_diffs = {"seq_no" : {"single" : exp_current_seq_no }},
518+ )
515519 else :
516520 assert msg == json .dumps (
517521 {"message" : "EndOfStream" , "last_seq_no" : {"single" : exp_final_seq_no }}
518522 )
519- cmp_dicts (original_state , state , exp_diffs = {"seq_no" : {"single" : exp_current_seq_no }})
520-
523+ cmp_dicts (
524+ original_state ,
525+ state ,
526+ exp_diffs = {"seq_no" : {"single" : exp_current_seq_no }},
527+ )
521528
522529 assert exp_iters == len (msgs_states )
523530
@@ -647,7 +654,7 @@ def test_language_pack_info_is_stored(mock_server):
647654 transcription_config = transcription_config ,
648655 stream = audio_stream ,
649656 audio_settings = audio_settings ,
650- )
657+ )
651658
652659 info = ws_client .get_language_pack_info ()
653660 assert info is not None
0 commit comments