Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/idlelib/idle_test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-312.pyc

�

&Μg	���dZddlZdd�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���tj����fd��}|S)Nc��������|��|j�d������fd���jd�j���j��r��y)Nc����	t���j��j��y#t$r�j	�Yyt
$r}|��j	�Yd}~yd}~wwxYw)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.pyrzVrun_in_tk_mainloop.<locals>.decorator.<locals>.new_test_method.<locals>.after_callback'sZ���G���(��J�J�u�d�o�o�~�F��%� ��I�I�K� � � #�I��I�I�K�K�� �s�,�A+�A+�A&�&A+r)rrr	�mainloop)�selfrrrrr�test_methods @@@@��r�new_test_methodz>run_in_tk_mainloop.<locals>.decorator.<locals>.new_test_methodsU���(��.�N��9�9�D��I�
G�
G�
�J�J�q�$�/�/�>�:��M�M�O�����)�	functools�wraps)rrrs` �r�	decoratorz%run_in_tk_mainloop.<locals>.decorators&���	����	%�	 �
&�	 �8�r�)rrs` r�run_in_tk_mainlooprs���2�@�r)�)�__doc__rrrrr�<module>r s��(��9r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists