HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/tkinter_testing_utils.cpython-310.pyc
o

�i	�@sdZddlZddd�ZdS)z"Utilities for testing with Tkinter�N�cs�fdd�}|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(['>>>', '>>>'])
    cst�����fdd��}|S)NcsJ�|��|j�d������fdd����d�j������r#��dS)Nc
snzt��Wn&ty���YdSty,}z
|����WYd}~dSd}~ww����j��dS)N)�next�
StopIteration�quit�	Exception�after�
after_idle)�exc)�after_callback�delay�	exception�root�test_generator��D/usr/local/lib/python3.10/idlelib/idle_test/tkinter_testing_utils.pyr
's��zVrun_in_tk_mainloop.<locals>.decorator.<locals>.new_test_method.<locals>.after_callbackr)r
rrZmainloop)�self)r�test_method)r
rr
rr�new_test_methods�z>run_in_tk_mainloop.<locals>.decorator.<locals>.new_test_method)�	functools�wraps)rr�r)rr�	decoratorsz%run_in_tk_mainloop.<locals>.decoratorr)rrrrr�run_in_tk_mainloops r)r)�__doc__rrrrrr�<module>s