Your IP : 216.73.216.213
B
R�X� � @ sP d dl mZ d dlmZ d dlmZ dd� ZG dd� d�Zd
d d
�Zdd� Z dS )� )�dedent)�wraps)�
getargspecc g s x| D ]
}|V qW dS )za
A utility function for creating a generator that will yield the
supplied arguments.
N� )�args�ir r �C/opt/alt/python37/lib/python3.7/site-packages/testfixtures/utils.py� generator s
r c @ s e Zd Zdd� ZdS )� Wrappingsc C s g | _ g | _d S )N)�before�after)�selfr r r �__init__ s zWrappings.__init__N)�__name__�
__module__�__qualname__r r r r r r
s r
Nc s � �fdd�}|S )z
A decorator that causes the supplied callables to be called before
or after the wrapped callable, as appropriate.
c sh t �dd �d kr8t� � t��� �fdd��}|}� |_n�}|j� � j��� �d k rd� j�d�� |S )N�
_wrappingsc s� t | �} tt��d t| �d � �}d}x.� jD ]$}|� }||k r0| �|� |d7 }q0W z
�| |�S x� jD ]
}|� qlW X d S )Nr � )�list�lenr r �appendr )r �kwZto_addZadded�c�r)�w�wrappedr r �wrapping! s
z'wrap.<locals>.wrapper.<locals>.wrappingr )�getattrr
r r r r r �insert)r r �f)r r )r r r �wrapper s zwrap.<locals>.wrapperr )r r r r )r r r �wrap s r! c
C s@ x:|D ]2}yt |j�| |_W q ttfk
r6 Y qX qW d S )N)r �__doc__�AttributeError� TypeError)Z docstringZobjs�objr r r �extend_docstring<