Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/testfixtures/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/testfixtures/__pycache__/components.cpython-37.pyc

B

R�X��@s:ddlZddlZddlmZddlmZGdd�d�ZdS)�N)�getSiteManager)�
Componentsc@s6eZdZdZe�ZdZdd�Zdd�Ze	dd��Z
d	S)
�TestComponentsz�
    A helper for providing a sterile registry when testing
    with :mod:`zope.component`.

    Instantiation will install an empty registry that will be returned
    by :func:`zope.component.getSiteManager`.
    FcsJtd��_t��fdd���_�j����jjsFt	�
�j	�d�j_dS)NZTestingcs�jS)N)�registry�)�selfr�H/opt/alt/python37/lib/python3.7/site-packages/testfixtures/components.py�<lambda>�z)TestComponents.__init__.<locals>.<lambda>T)rrr�sethook�old�	instances�add�	__class__�atexit_setup�atexit�register)rr)rr�__init__s
zTestComponents.__init__cCst�|j�|j�|�dS)z�
        Remove the sterile registry and replace it with the one that
        was in place before this :class:`TestComponents` was
        instantiated.
        N)rrrr
�remove)rrrr�	uninstallszTestComponents.uninstallcCs|jrt�d�dS)Nz5TestComponents instances not uninstalled by shutdown!)r
�warnings�warn)�clsrrrr(szTestComponents.atexitN)�__name__�
__module__�__qualname__�__doc__�setr
rrr�classmethodrrrrrrs	r)rrZzope.componentrZzope.component.registryrrrrrr�<module>s