55from itertools import chain
66import unittest
77import unittest .mock
8- from test .support import requires , swap_attr
9- from test import support
8+ from test .support import adjust_int_max_str_digits , requires , swap_attr
9+ from test . support . testcase import ExtraAssertions
1010import tkinter as tk
1111from idlelib .idle_test .tkinter_testing_utils import run_in_tk_mainloop
1212
@@ -391,7 +391,7 @@ def assert_colors_are_equal(colors):
391391 assert_colors_are_equal (orig_colors )
392392
393393
394- class ShellSidebarTest (unittest .TestCase ):
394+ class ShellSidebarTest (unittest .TestCase , ExtraAssertions ):
395395 root : tk .Tk = None
396396 shell : PyShell = None
397397
@@ -613,7 +613,7 @@ def test_interrupt_recall_undo_redo(self):
613613
614614 @run_in_tk_mainloop ()
615615 def test_very_long_wrapped_line (self ):
616- with support . adjust_int_max_str_digits (11_111 ), \
616+ with adjust_int_max_str_digits (11_111 ), \
617617 swap_attr (self .shell , 'squeezer' , None ):
618618 self .do_input ('x = ' + '1' * 10_000 + '\n ' )
619619 yield
@@ -725,7 +725,7 @@ def test_copy(self):
725725
726726 text .tag_add ('sel' , f'{ first_line } .0' , 'end-1c' )
727727 selected_text = text .get ('sel.first' , 'sel.last' )
728- self .assertTrue (selected_text . startswith ( 'if True:\n ' ) )
728+ self .assertStartsWith (selected_text , 'if True:\n ' )
729729 self .assertIn ('\n 1\n ' , selected_text )
730730
731731 text .event_generate ('<<copy>>' )
@@ -749,7 +749,7 @@ def test_copy_with_prompts(self):
749749
750750 text .tag_add ('sel' , f'{ first_line } .3' , 'end-1c' )
751751 selected_text = text .get ('sel.first' , 'sel.last' )
752- self .assertTrue (selected_text . startswith ( 'True:\n ' ) )
752+ self .assertStartsWith (selected_text , 'True:\n ' )
753753
754754 selected_lines_text = text .get ('sel.first linestart' , 'sel.last' )
755755 selected_lines = selected_lines_text .split ('\n ' )
0 commit comments