HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python38/lib/python3.8/site-packages/pymysql/tests/__pycache__/base.cpython-38.pyc
U

�
V�
�@sZddlZddlZddlZddlZddlZddlZddlZddlmZGdd�dej	�Z
dS)�N�)�CPYTHONc	@s�eZdZej�ej�e�d�Zej�	e�rJe
e��Ze�
e�ZW5QRXn ddddddd�ddddd	�gZd
d�Zdd
�Zdd�Zddd�Zdd�Zdd�ZdS)�PyMySQLTestCasezdatabases.json�	localhost�root�Ztest_pymysqlT)�host�user�passwd�db�use_unicode�local_infileZ
test_pymysql2)rr	r
rcCs4|��}tdd�t�d|��ddd�D��}||kS)z�Return True if the given connection is on the version given or
        greater.

        e.g.::

            if self.mysql_server_is(conn, (5, 6, 4)):
                # do something for MySQL 5.6.4 and above
        css"|]}|dk	rt|�ndVqdS)Nr)�int)�.0�dig�r�C/opt/alt/python38/lib/python3.8/site-packages/pymysql/tests/base.py�	<genexpr>$s�z2PyMySQLTestCase.mysql_server_is.<locals>.<genexpr>z(\d+)\.(\d+)\.(\d+)�r�)�get_server_info�tuple�re�match�group)�self�conn�
version_tuple�server_versionZserver_version_tuplerrr�mysql_server_iss
	�zPyMySQLTestCase.mysql_server_iscCs6g|_|jD]}|j�tjf|��q|�|j�dS�N)�connections�	databases�append�pymysql�connect�
addCleanup�_teardown_connections)r�paramsrrr�setUp+s
zPyMySQLTestCase.setUpcCs|jD]}|��qdSr )r!�close)r�
connectionrrrr'1s
z%PyMySQLTestCase._teardown_connectionsc	Cs`|��}t��� t�d�|�d|f�W5QRX|�|�|��|r\|�|j||�dS)z�create a table.

        Ensures any existing version of that table is first dropped.

        Also adds a cleanup rule to drop the table after the test
        completes.
        �ignore�drop table if exists `%s`N)�cursor�warnings�catch_warnings�simplefilter�executer*r&�
drop_table)rr+�	tablenameZddl�cleanupr.rrr�safe_create_table5s


z!PyMySQLTestCase.safe_create_tablec	CsB|��}t��� t�d�|�d|f�W5QRX|��dS)Nr,r-)r.r/r0r1r2r*)rr+r4r.rrrr3Gs


zPyMySQLTestCase.drop_tablecCst��tst��dS)zfEnsure cycles are collected via gc.

        Runs additional times on non-CPython platforms.

        N)�gcZcollectr)rrrr�safe_gc_collectNszPyMySQLTestCase.safe_gc_collectN)T)�__name__�
__module__�__qualname__�os�path�join�dirname�__file__�fname�exists�open�f�json�loadr"rr)r'r6r3r8rrrrr
s$
��
r)r7rEr<rr/Z	unittest2r$�_compatrZTestCaserrrrr�<module>s