$12 GRAYBYTE WORDPRESS FILE MANAGER $90

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.174
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/hc_python/lib/python3.12/site-packages/nose/plugins/__pycache__/

HOME
Current File : /opt/hc_python/lib/python3.12/site-packages/nose/plugins/__pycache__//isolate.cpython-312.pyc
�

H��g���^�dZddlZddlZddlmZej
d�ZGd�de�Zy)a�The isolation plugin resets the contents of sys.modules after running
each test module or package. Use it by setting ``--with-isolation`` or the
NOSE_WITH_ISOLATION environment variable.

The effects are similar to wrapping the following functions around the
import and execution of each test module::

    def setup(module):
        module._mods = sys.modules.copy()
    
    def teardown(module):
        to_del = [ m for m in sys.modules.keys() if m not in
                   module._mods ]
        for mod in to_del:
            del sys.modules[mod]
        sys.modules.update(module._mods)

Isolation works only during lazy loading. In normal use, this is only
during discovery of modules within a directory, where the process of
importing, loading tests and running tests from each module is
encapsulated in a single loadTestsFromName call. This plugin
implements loadTestsFromNames to force the same lazy-loading there,
which allows isolation to work in directed mode as well as discovery,
at the cost of some efficiency: lazy-loading names forces full context
setup and teardown to run for each name, defeating the grouping that
is normally used to ensure that context setup and teardown are run the
fewest possible times for a given set of names.

.. warning ::

    This plugin should not be used in conjunction with other plugins
    that assume that modules, once imported, will stay imported; for
    instance, it may cause very odd results when used with the coverage
    plugin.

�N)�Pluginznose.plugins.isolationc�8�eZdZdZdZdZd�Zd�Zd�Zd
d�Z	d	�Z
y)�IsolationPlugina�
    Activate the isolation plugin to isolate changes to external
    modules to a single test module or package. The isolation plugin
    resets the contents of sys.modules after each test module or
    package runs to its state before the test. PLEASE NOTE that this
    plugin should not be used with the coverage plugin, or in any other case
    where module reloading may produce undesirable side-effects.
    �
�	isolationc�@�tj|||�g|_y)zConfigure plugin.
        N)r�	configure�
_mod_stack)�self�options�confs   �C/opt/hc_python/lib/python3.12/site-packages/nose/plugins/isolate.pyr	zIsolationPlugin.configure:s��	����w��-����c�v�tjj�}|jj	|�y)z+Copy sys.modules onto my mod stack
        N)�sys�modules�copyr
�append)r�modss  r�
beforeContextzIsolationPlugin.beforeContext@s(���{�{���!�������t�$rc�R�|jj�}ttjj��D�cgc]	}||vs�|��}}|r.tjd|�|D]}tj|=�tjj|�ycc}w)zkPop my mod stack and restore sys.modules to the state
        it was in when mod stack was pushed.
        z removing sys modules entries: %sN)	r
�pop�listrr�keys�log�debug�update)rr�m�to_del�mods     r�afterContextzIsolationPlugin.afterContextFs������"�"�$��"�3�;�;�#3�#3�#5�6�I�6��!�4�-�1�6��I���I�I�8�&�A����K�K��$�������4� ��Js�	B$�B$Nc�������rt��dk(ry|j�|jj�����fd�}�j	|�gfS)z�Create a lazy suite that calls beforeContext and afterContext
        around each name. The side-effect of this is that full context
        fixtures will be set up and torn down around each test named.
        �Nc3��K��D]7}�j��j|������j��9y�w)N)�module)r�loadTestsFromNamer!)�name�loaderr%�names�pluginss ����r�lazyz0IsolationPlugin.loadTestsFromNames.<locals>.lazy\s?��������%�%�'��.�.�t�F�.�C�C��$�$�&��s�>A)�lenr(r
r*�
suiteClass)rr)r%r+r(r*s `` @@r�loadTestsFromNamesz"IsolationPlugin.loadTestsFromNamesRsJ�����E�
�a��������)�)�#�#��	'�
�!�!�$�'��,�,rc��||_y)zJGet handle on test loader so we can use it in loadTestsFromNames.
        N)r()rr(s  r�prepareTestLoaderz!IsolationPlugin.prepareTestLoadercs����r)N)�__name__�
__module__�__qualname__�__doc__�scorer'r	rr!r.r0�rrrr.s,���
�E��D��%�
!�-�"rr)r4�loggingr�nose.pluginsr�	getLoggerrrr6rr�<module>r:s7��#�J�
���g���0�1��8�f�8r


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2025 8.03 AM
root / root
0755
__init__.cpython-312.pyc
6.404 KB
4 Apr 2025 8.03 AM
root / root
0644
allmodules.cpython-312.pyc
2.301 KB
4 Apr 2025 8.03 AM
root / root
0644
attrib.cpython-312.pyc
9.89 KB
4 Apr 2025 8.03 AM
root / root
0644
base.cpython-312.pyc
30.225 KB
4 Apr 2025 8.03 AM
root / root
0644
builtin.cpython-312.pyc
1.157 KB
4 Apr 2025 8.03 AM
root / root
0644
capture.cpython-312.pyc
5.098 KB
4 Apr 2025 8.03 AM
root / root
0644
collect.cpython-312.pyc
4.975 KB
4 Apr 2025 8.03 AM
root / root
0644
cover.cpython-312.pyc
13.917 KB
4 Apr 2025 8.03 AM
root / root
0644
debug.cpython-312.pyc
3.077 KB
4 Apr 2025 8.03 AM
root / root
0644
deprecated.cpython-312.pyc
2.106 KB
4 Apr 2025 8.03 AM
root / root
0644
doctests.cpython-312.pyc
21.004 KB
4 Apr 2025 8.03 AM
root / root
0644
errorclass.cpython-312.pyc
9.29 KB
4 Apr 2025 8.03 AM
root / root
0644
failuredetail.cpython-312.pyc
2.273 KB
4 Apr 2025 8.03 AM
root / root
0644
isolate.cpython-312.pyc
5.177 KB
4 Apr 2025 8.03 AM
root / root
0644
logcapture.cpython-312.pyc
12.53 KB
4 Apr 2025 8.03 AM
root / root
0644
manager.cpython-312.pyc
21.718 KB
4 Apr 2025 8.03 AM
root / root
0644
multiprocess.cpython-312.pyc
38.254 KB
4 Apr 2025 8.03 AM
root / root
0644
plugintest.cpython-312.pyc
17.021 KB
4 Apr 2025 8.03 AM
root / root
0644
prof.cpython-312.pyc
6.642 KB
4 Apr 2025 8.03 AM
root / root
0644
skip.cpython-312.pyc
2.459 KB
4 Apr 2025 8.03 AM
root / root
0644
testid.cpython-312.pyc
11.73 KB
4 Apr 2025 8.03 AM
root / root
0644
xunit.cpython-312.pyc
16.276 KB
4 Apr 2025 8.03 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF