@@ -131,14 +131,7 @@ def test_rp_log_format(mock_client_init):
131131 expect (mock_client .log .call_count == 1 )
132132 message = mock_client .log .call_args_list [0 ][0 ][1 ]
133133 expect (len (message ) > 0 )
134- if sys .version_info < (3 , 11 ):
135- expect (message == '(examples.test_rp_logging) ' + LOG_MESSAGE +
136- ' (test_rp_logging.py:24)' )
137- else :
138- # FIXME: implement stacktrace preserve solution for Python 3.11
139- warnings .warn ('FIXME: implement stacktrace preserve solution for Python 3.11' , RuntimeWarning )
140- expect (message == '(examples.test_rp_logging) ' + LOG_MESSAGE +
141- ' (rp_logging.py:111)' )
134+ expect (message == f'(examples.test_rp_logging) { LOG_MESSAGE } (test_rp_logging.py:24)' )
142135 assert_expectations ()
143136
144137
@@ -304,8 +297,8 @@ def test_launch_uuid_print(mock_client_init):
304297
305298 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
306299 expect (mock_client_init .call_count == 1 )
307-
308- expect ('Report Portal Launch UUID:' in str_io . getvalue () )
300+ expect ( mock_client_init . call_args_list [ 0 ][ 1 ][ 'launch_uuid_print' ] == print_uuid )
301+ expect (mock_client_init . call_args_list [ 0 ][ 1 ][ 'print_output' ] is str_io )
309302 assert_expectations ()
310303
311304
@@ -326,8 +319,8 @@ def test_launch_uuid_print_stderr(mock_client_init):
326319
327320 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
328321 expect (mock_client_init .call_count == 1 )
329-
330- expect ('Report Portal Launch UUID:' in str_io . getvalue () )
322+ expect ( mock_client_init . call_args_list [ 0 ][ 1 ][ 'launch_uuid_print' ] == print_uuid )
323+ expect (mock_client_init . call_args_list [ 0 ][ 1 ][ 'print_output' ] is str_io )
331324 assert_expectations ()
332325
333326
@@ -348,8 +341,8 @@ def test_launch_uuid_print_invalid_output(mock_client_init):
348341
349342 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
350343 expect (mock_client_init .call_count == 1 )
351-
352- expect ('Report Portal Launch UUID:' in str_io . getvalue () )
344+ expect ( mock_client_init . call_args_list [ 0 ][ 1 ][ 'launch_uuid_print' ] == print_uuid )
345+ expect (mock_client_init . call_args_list [ 0 ][ 1 ][ 'print_output' ] is str_io )
353346 assert_expectations ()
354347
355348
@@ -368,6 +361,6 @@ def test_no_launch_uuid_print(mock_client_init):
368361
369362 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
370363 expect (mock_client_init .call_count == 1 )
371-
372- expect ('Report Portal Launch UUID:' not in str_io . getvalue () )
364+ expect ( mock_client_init . call_args_list [ 0 ][ 1 ][ 'launch_uuid_print' ] is False )
365+ expect (mock_client_init . call_args_list [ 0 ][ 1 ][ 'print_output' ] is str_io )
373366 assert_expectations ()
0 commit comments