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.opt-1.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.jsonZ	localhost�root�Ztest_pymysqlT)�host�user�passwd�dbZuse_unicodeZlocal_infileZ
test_pymysql2)rrr	r
cCs4|��}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�)Zget_server_info�tuple�re�match�group)�selfZconnZ
version_tupleZserver_versionZserver_version_tuplerrr�mysql_server_iss
	�zPyMySQLTestCase.mysql_server_iscCs6g|_|jD]}|j�tjf|��q|�|j�dS�N)�connections�	databases�append�pymysqlZconnect�
addCleanup�_teardown_connections)rZparamsrrr�setUp+s
zPyMySQLTestCase.setUpcCs|jD]}|��qdSr)r�close)r�
connectionrrrr1s
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"�	tablenameZddlZcleanupr%rrr�safe_create_table5s


z!PyMySQLTestCase.safe_create_tablec	CsB|��}t��� t�d�|�d|f�W5QRX|��dS)Nr#r$)r%r&r'r(r)r!)rr"r+r%rrrr*Gs


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__Zfname�exists�open�f�json�loadrrr rr,r*r.rrrrr
s$
��
r)r-r:r2rr&Z	unittest2rZ_compatrZTestCaserrrrr�<module>s