관리-도구
편집 파일: profiling.cpython-37.pyc
B ��4]A! � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddlm Z ddlmZ dd lmZ dd lm Z yddlZW n ek r� dZY nX dZdZG dd� de�Zddd�Zejddd��ZdS )z�Profiling support for unit and performance tests. These are special purpose profiling methods which operate in a more fine-grained way than nose's profiling plugin. � N� )�config)� gc_collect� )�jython)�pypy)�update_wrapper)�win32c @ sT e Zd ZdZdd� Zedd� �Zdd� Zdd � Zd d� Z dd � Z dd� Zdd� ZdS )�ProfileStatsFilez�"Store per-platform/fn profiling results in a file. We're still targeting Py2.5, 2.4 on 0.7 with no dependencies, so no json lib :( need to roll something silly c C sz t jd k ot jj| _| jp*t jd k o*t jj| _tj�|�| _ tj� | j �d | _t� dd� �| _| �� | jrv| �� d S )N���c S s t �t�S )N)�collections�defaultdict�dict� r r �O/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/testing/profiling.py�<lambda>: � z+ProfileStatsFile.__init__.<locals>.<lambda>)r �optionsZforce_write_profiles�force_writeZwrite_profiles�write�os�path�abspath�fname�split�short_fnamer r �data�_read�_write)�self�filenamer r r �__init__0 s zProfileStatsFile.__init__c C s� t jjd t jj }d�dd� tjdd� D ��}|g}|�|� trP|�d� t r^|�d� t rl|�d � |�t jjjr~d nd� t j �� }|�|r�dp�d � d�|�S )N�_�.c S s g | ]}t |��qS r )�str)�.0�vr r r � <listcomp>H s z1ProfileStatsFile.platform_key.<locals>.<listcomp>r r r r �winZ nativeunicodeZdbapiunicodeZcextensionsZ nocextensions)r Zdb�nameZdriver�join�sys�version_info�appendr r r ZdialectZconvert_unicode�requirementsZ_has_cextensions)r Z dbapi_key� py_versionZplatform_tokensZ _has_cextr r r �platform_keyB s zProfileStatsFile.platform_keyc C s t }|| jko| j| j| kS )N)� _current_testr r0 )r �test_keyr r r � has_stats[ s zProfileStatsFile.has_statsc C s� t }| j| }|| j }d|kr.g |d<