Sindbad~EG File Manager
�
&Μg � � � d Z ddlZdd�Zy)z"Utilities for testing with Tkinter� Nc � � � � fd�}|S )a� Decorator for running a test method with a real Tk mainloop.
This starts a Tk mainloop before running the test, and stops it
at the end. This is faster and more robust than the common
alternative method of calling .update() and/or .update_idletasks().
Test methods using this must be written as generator functions,
using "yield" to allow the mainloop to process events and "after"
callbacks, and then continue the test from that point.
The delay argument is passed into root.after(...) calls as the number
of ms to wait before passing execution back to the generator function.
This also assumes that the test class has a .root attribute,
which is a tkinter.Tk object.
For example (from test_sidebar.py):
@run_test_with_tk_mainloop()
def test_single_empty_input(self):
self.do_input('
')
yield
self.assert_sidebar_lines_end_with(['>>>', '>>>'])
c �F �� � t j � � �� fd�� }|S )Nc � ������ �| � �| j �d ������fd���j d�j �� �j � �r��y )Nc �� �� t �� �j ��j �� y # t $ r �j � Y y t
$ r} | ��j � Y d } ~ y d } ~ ww xY w)N)�next�after�
after_idle�
StopIteration�quit� Exception)�exc�after_callback�delay� exception�root�test_generators ������D/usr/local/lib/python3.12/idlelib/idle_test/tkinter_testing_utils.pyr zVrun_in_tk_mainloop.<locals>.decorator.<locals>.new_test_method.<locals>.after_callback'