@@ -83,9 +83,14 @@ def test_write_styled(_, SetConsoleTextAttribute, win32_handle):
83
83
84
84
assert f .getvalue () == text
85
85
# Ensure we set the text attributes and then reset them after writing styled text
86
- assert call_args [0 ].args == (win32_handle ,)
87
- assert call_args [0 ].kwargs ["attributes" ].value == 64
88
- assert call_args [1 ] == call (win32_handle , attributes = DEFAULT_STYLE_ATTRIBUTE )
86
+
87
+ first_args , first_kwargs = call_args [0 ]
88
+ second_args , second_kwargs = call_args [1 ]
89
+
90
+ assert first_args == (win32_handle ,)
91
+ assert first_kwargs ["attributes" ].value == 64
92
+ assert second_args == (win32_handle ,)
93
+ assert second_kwargs ["attributes" ] == DEFAULT_STYLE_ATTRIBUTE
89
94
90
95
@patch .object (_win32_console , "FillConsoleOutputCharacter" , return_value = None )
91
96
@patch .object (_win32_console , "FillConsoleOutputAttribute" , return_value = None )
@@ -294,8 +299,10 @@ def test_hide_cursor(_, SetConsoleCursorInfo, win32_handle):
294
299
call_args = SetConsoleCursorInfo .call_args_list
295
300
296
301
assert len (call_args ) == 1
297
- assert call_args [0 ].kwargs ["cursor_info" ].bVisible == 0
298
- assert call_args [0 ].kwargs ["cursor_info" ].dwSize == 100
302
+
303
+ args , kwargs = call_args [0 ]
304
+ assert kwargs ["cursor_info" ].bVisible == 0
305
+ assert kwargs ["cursor_info" ].dwSize == 100
299
306
300
307
@patch .object (_win32_console , "SetConsoleCursorInfo" , return_value = None )
301
308
@patch .object (
@@ -308,8 +315,10 @@ def test_show_cursor(_, SetConsoleCursorInfo, win32_handle):
308
315
call_args = SetConsoleCursorInfo .call_args_list
309
316
310
317
assert len (call_args ) == 1
311
- assert call_args [0 ].kwargs ["cursor_info" ].bVisible == 1
312
- assert call_args [0 ].kwargs ["cursor_info" ].dwSize == 100
318
+
319
+ args , kwargs = call_args [0 ]
320
+ assert kwargs ["cursor_info" ].bVisible == 1
321
+ assert kwargs ["cursor_info" ].dwSize == 100
313
322
314
323
@patch .object (_win32_console , "SetConsoleTitle" , return_value = None )
315
324
def test_set_title (SetConsoleTitle ):
0 commit comments