PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/asyncio.cpython-312.pyc

�

���g���r�ddlmZddlmZddlZddlmZddlmZdZ	e�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zy)�)�annotations)�wrapsN�)�config�)�
_AsyncUtilTc�,�tj�y)zcalled when the test finishesN)�_async_util�close���K/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/testing/asyncio.py�	_shutdownr#s�����r
c�4�tj|g|��i|��S�N)r
�run��fn�args�kwargss   r�_run_coroutine_functionr(s���?�?�2�/��/��/�/r
c�P�ts||i|��Stj|g|��i|��S)aRun a function in an asyncio loop unconditionally.

    This function is used for provisioning features like
    testing a database connection for server info.

    Note that for blocking IO database drivers, this means they block the
    event loop.

    )�ENABLE_ASYNCIOr
�run_in_greenletrs   r�
_assume_asyncr,s2����4�"�6�"�"��&�&�r�;�D�;�F�;�;r
c��ts||i|��Stjrtj|g|��i|��S||i|��S)a�Run a function in an asyncio loop if any current drivers might need it.

    This function is used for provisioning features that take
    place outside of a specific database driver being selected, so if the
    current driver that happens to be used for the provisioning operation
    is an async driver, it will run in asyncio and not fail.

    Note that for blocking IO database drivers, this means they block the
    event loop.

    )rr�	any_asyncr
rrs   r�_maybe_async_provisioningr=sK����4�"�6�"�"�
����*�*�2�?��?��?�?��4�"�6�"�"r
c��ts||i|��Stjj}|rt	j
|g|��i|��S||i|��S)z�Run a function in an asyncio loop if the current selected driver is
    async.

    This function is used for test setup/teardown and tests themselves
    where the current DB driver is known.


    )rr�_current�is_asyncr
r)rrrr!s    r�_maybe_asyncr"RsT����4�"�6�"�"����'�'�H���*�*�2�?��?��?�?��4�"�6�"�"r
c�����tj��r&t���fd��t�����fd��}|St���fd��}|S)z�Apply the _maybe_async function to an existing function and return
    as a wrapped callable, supporting generator functions as well.

    This is currently used for pytest fixtures that support generator use.

    c�>��	t|�S#t$r�cYSwxYwr)�next�
StopIteration)�gen�_stops �r�	call_nextz'_maybe_async_wrapper.<locals>.call_nextqs&���
��C�y� �� �
���
�s�
��c?�J�K��|i|��}	t�|�}|�ury|����wr�r")rrr'�valuer(r)rs    ���r�wrap_fixturez*_maybe_async_wrapper.<locals>.wrap_fixturexs9������d�%�f�%�C��$�Y��4���E�>����	�s� #c�"��t�g|��i|��Srr+)rrrs  �rr-z*_maybe_async_wrapper.<locals>.wrap_fixture�s�����4�T�4�V�4�4r
)�inspect�isgeneratorfunction�objectr)rr-r(r)s` @@r�_maybe_async_wrapperr2fs_����"�"�2�&����	�
�r��	�
�	���	
�r��	5�
�	5��r
)�
__future__r�	functoolsrr/�r�util.concurrencyrrr
rrrrr"r2rr
r�<module>r7sB��*#����)����l���
0�<�"#�*#�(!r

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic