Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_imp.cpython-311.pyc
�

�KeWL���ddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZddl	mZddl	m
Z
ddlZddlZe
jd��ZddlZejjZd�ZGd	�d
ej��ZGd�dej��ZGd
�dej��ZGd�dej��ZGd�dej��Zedkrej��dSdS)�N)�support)�
import_helper)�	os_helper)�
script_helper)�warnings_helper�impc��tj|��}tjt	t
dd��dud��|��S)zXDecorator to skip a test if not running under CPython or lacking
    imp.load_dynamic().�load_dynamicNzimp.load_dynamic() required)r�cpython_only�unittest�skipIf�getattrr)�meths �7/usr/local/apps/python3/lib/python3.11/test/test_imp.py�requires_load_dynamicrsR�����%�%�D�:�8�?�7�3���=�=��E�8�:�:�:>�@�@�@�c��eZdZdZd�Zd�ZdS)�	LockTestsz)Very basic test of import lock functions.c�h�|�t���|d|z��dS)Nz!expected imp.lock_held() to be %r)�assertEqualr�	lock_held)�self�expecteds  r�verify_lock_statezLockTests.verify_lock_state"s=����������(�@�8�K�	M�	M�	M�	M�	Mrc���d}t���}|�|��t|��D]0}t���|�d���1t|��D]}t����|�|��|sB	t���|�d��dS#t$rYdSwxYwdS)N�2Tz5release_lock() without lock should raise RuntimeError)rrr�range�acquire_lock�release_lock�fail�RuntimeError)r�LOOPS�lock_held_at_start�is    r�testLockzLockTests.testLock%s����!�]�]�_�_�����1�2�2�2��u���	)�	)�A��������"�"�4�(�(�(�(��u���	�	�A��������	
���1�2�2�2�!�	,�
,�� � �"�"�"��	�	�+�,�,�,�,�,�� �
�
�
����
����	,�	,s�4C$�$
C2�1C2N)�__name__�
__module__�__qualname__�__doc__rr%�rrrrs;������3�3�M�M�M�,�,�,�,�,rrc�N�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ed	���Zed
���Z
ed���Zed���Zed
���Zejejd��d���Zd�Zd�Zejd���Zd�Zd�Zd�Zd�Zejd���ZdS)�ImportTestsc�^�tjd��}|j|_|j|_dS)Nztest.encoded_modules)�	importlib�
import_module�test_strings�__path__�	test_path)r�mods  r�setUpzImportTests.setUpAs+���%�&<�=�=���,��������rc��|jD]8\}}}tjd|z��}|�||j���9dS)Nztest.encoded_modules.module_)r0r.r/r�test)r�modname�encoding�teststrr3s     r�test_import_encoded_modulez&ImportTests.test_import_encoded_moduleFs_��*.�*;�	0�	0�&�G�X�w��)�+4�6=�+>�?�?�C����W�c�h�/�/�/�/�	0�	0rc��|jD]b\}}}t�d|z|j��d5}|�|j|��ddd��n#1swxYwY�ctj�t��g}|�
t��5t�d|��ddd��dS#1swxYwYdS)N�module_r�badsyntax_pep3120)r0r�find_moduler2rr8�os�path�dirname�__file__�assertRaises�SyntaxError)rr3r8�_�fdr@s      r�test_find_module_encodingz%ImportTests.test_find_module_encodingLsJ�� $� 1�	8�	8��C��1�����S��$�.�A�A�!�D�
8��� � ���h�7�7�7�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8�������)�)�*��
�
�
�{�
+�
+�	7�	7��O�O�/��6�6�6�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7�	7�	7s#�A�A#	�&A#	�*C�C�Cc� �|jD]�\}}}t�d|z|j��\}}}|5|�|d��|�|j|��|�|���d��|�|���d|z��ddd��n#1swxYwY��t�d��\}}}|5|�|d��|�|jd��|�|���d��|�|���d��ddd��dS#1swxYwYdS)Nr<rz# test %s encoding
�tokenize�utf-8z*"""Tokenization help for Python programs.
)	r0rr>r2�assertNotEqualrr8�tell�readline)rr3r8rE�fp�filename�infos       r�test_issue1267zImportTests.test_issue1267Us#�� $� 1�	-�	-��C��1�"%�/�/�)�c�/�26�.�#B�#B��B��$��
-�
-��#�#�B��-�-�-�� � ���h�7�7�7�� � ������A�.�.�.�� � ������0F�#+�1,�-�-�-�	
-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-����
-�
-�
-�
-��!�_�_�Z�8�8���H�d�
�	L�	L�����D�)�)�)����R�[�'�2�2�2����R�W�W�Y�Y��*�*�*����R�[�[�]�]�J�
L�
L�
L�		L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L����	L�	L�	L�	L�	L�	Ls%�BC�C	�C	�4BF�F�
Fc�`�d}tj�dd��	t|dzdd���5}|�d��ddd��n#1swxYwYt
�|��\}}}|���|�|j	d	��tjd=tj|dz��tj|d
z��dS#tjd=tj|dz��tj|d
z��wxYw)N�test_imp_helperr�.�.py�wzlatin-1�r8z%# coding: cp1252
u = 'test.test_imp'
�cp1252�.pyc)�sysr@�insert�open�writerr>�closerr8r�unlink)r�
temp_mod_name�filerOrPs     r�test_issue3594zImportTests.test_issue3594hsg��)�
������3����		5��m�e�+�S�9�E�E�E�
F���
�
�D�E�E�E�
F�
F�
F�
F�
F�
F�
F�
F�
F�
F�
F����
F�
F�
F�
F�#&�?�?�=�#A�#A� �D�(�D��J�J�L�L�L����T�]�H�5�5�5�������]�U�2�3�3�3���]�V�3�4�4�4�4�4��������]�U�2�3�3�3���]�V�3�4�4�4�4���s/�C0�A�C0�A�C0�"A�#AC0�0=D-c�
�tj��}ddddddddddd�
}tjdkr|�|d��d	}n|�|��}|s|�d
|z��|�|��}d|z}d|z}tj�	|d
��}	tj�
dtj��t|dzdd���5}|�
d��ddd��n#1swxYwYt�|��\}}	}
|5|�|��|�|	dd��|����|�|
dd��|�|
dd��|�|
dtj��t�|||	|
��}|�|jd��ddd��n#1swxYwYt-j��5t-jd��t�||dz��}ddd��n#1swxYwY|�|jd��t-j��5t-jd��tjs6t�|t�|dz����}ddd��n#1swxYwY|�|jd��tj�|��stj|��t|dd���5}|�
d��ddd��n#1swxYwYt-j��5t-jd��t�||��}ddd��n#1swxYwY|�|j d��tjd=dD]0}
tCj"||
z��tCj"||
z���1tCj#|��tCj#d��dS#tjd=dD]0}
tCj"||
z��tCj"||
z���1tCj#|��tCj#d��wxYw)Ns�������)
rJ�cp1250�cp1251rX�cp1253�cp1254�cp1255�cp1256�cp1257�cp1258�darwinrJsäz2can't run this test with %s as filesystem encoding�test_imp_helper_�test_imp_helper_package_z__init__.pyrrUrVrWza = 1
�����r��ignorezb = 2
)rUrY�__pycache__)$rZ�getfilesystemencoding�platformr�get�skipTest�decoder?r@�joinr[�curdirr\r]rr>�assertIsNotNone�
assertTrue�endswith�	PY_SOURCE�load_module�a�warnings�catch_warnings�simplefilter�load_source�dont_write_bytecode�
load_compiled�cache_from_source�exists�mkdir�load_package�brr_�rmtree)r�fs_encoding�
known_locales�special_char�decoded_charr`�test_package_name�init_file_namerarOrPr3�package�exts              r�test_issue5604zImportTests.test_issue5604vs����/�1�1��"������������
��<�8�#�#����[�'�2�2�2�(�L�L�(�,�,�[�9�9�L��	)��M�M�N�'�(�
)�
)�
)�#�*�*�;�7�7��*�\�9�
�6��E������&7��G�G��,	,�
�H�O�O�A�r�y�)�)�)��m�e�+�S�7�C�C�C�
&�t��
�
�9�%�%�%�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&�#&�?�?�=�#A�#A� �D�(�D��
+�
+��$�$�T�*�*�*������"��
� 6� 6�}� E� E�F�F�F�� � ��a��%�0�0�0�� � ��a��#�.�.�.�� � ��a��#�-�8�8�8��o�o�m�T�8�T�J�J��� � ����*�*�*�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+����
+�
+�
+�
+��(�*�*�
L�
L��%�h�/�/�/��o�o�m�]�U�5J�K�K��
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L����
L�
L�
L�
L�
���S�U�A�&�&�&��(�*�*�
F�
F��%�h�/�/�/��.�F��+�+�%��-�-�m�e�.C�D�D�F�F�C�
F�
F�
F�
F�
F�
F�
F�
F�
F�
F�
F����
F�
F�
F�
F�
���S�U�A�&�&�&��7�>�>�"3�4�4�
,���*�+�+�+��n�c�G�<�<�<�
&���
�
�9�%�%�%�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&��(�*�*�
Q�
Q��%�h�/�/�/��*�*�+<�>O�P�P��
Q�
Q�
Q�
Q�
Q�
Q�
Q�
Q�
Q�
Q�
Q����
Q�
Q�
Q�
Q�
���W�Y��*�*�*�����&�
7�
7��� ���!4�5�5�5�� ��#�!5�6�6�6�6���.�/�/�/���]�+�+�+�+�+������&�
7�
7��� ���!4�5�5�5�� ��#�!5�6�6�6�6���.�/�/�/���]�+�+�+�+���s��9?R�8D�R�D�R�!D�"#R�CH-�!R�-H1�1R�4H1�5R�3J
�>R�
J�R�J�1R�AL&�R�&L*�*R�-L*�.A#R�N3�'R�3N7�7R�:N7�;R�0P
�R�
P�R�P�R�A*Tc��tj�t��}|�t
tjd|g��dS)Nr=)r?r@rArBrCrDrr>)rr@s  r�test_issue9319zImportTests.test_issue9319�sJ���w���x�(�(�����+��/�+>���	H�	H�	H�	H�	Hrc��tjddt��5ddl}|j}|j}t
j��5t�	d��}|�
|dj��tjdg|�R�}|�
||��|�
||j��|�||j��ddd��n#1swxYwYddd��dS#1swxYwYdS)Nr?zos.pathr)r�CleanImport�OS_PATH_NAMEr?r@�getenvr�EnvironmentVarGuardrr>�
addCleanupr^r��assertIs�assertIsNot)rr?�	orig_path�orig_getenv�x�new_oss      r�test_load_from_sourcez!ImportTests.test_load_from_source�sz���
&�t�Y��
E�
E�
	=�
	=��I�I�I���I��)�K��.�0�0�
=�
=��O�O�D�)�)������!��
�+�+�+����2��2�2�2���
�
�b�&�)�)�)��
�
�i���5�5�5�� � ��f�m�<�<�<�

=�
=�
=�
=�
=�
=�
=�
=�
=�
=�
=����
=�
=�
=�
=�	
	=�
	=�
	=�
	=�
	=�
	=�
	=�
	=�
	=�
	=�
	=�
	=����
	=�
	=�
	=�
	=�
	=�
	=s6�&C?�BC'�C?�'C+	�+C?�.C+	�/C?�?D�Dc���d}t�|��}|d}|�|�|j��tj|g|�R�}|�|j|��dS)N�_heapqr)rr>r�r^r�rr&)r�exampler��file_r3s     r�test_issue15828_load_extensionsz+ImportTests.test_issue15828_load_extensions�sr�����O�O�G�$�$���!������O�O�E�K�(�(�(��o�g�*��*�*�*�������w�/�/�/�/�/rc�N�d}t�|��\}}}|���t�||��}t�d|��}t�d|��}|�|j|��|�|jd��|�|jd��|�t��5t�d|��ddd��dS#1swxYwYdS)N�_testimportmultiple�_testimportmultiple_foo�_testimportmultiple_bar�nonexistent)rr>r^r
rr&rC�ImportError)r�m�fileobj�pathname�description�mod0�mod1�mod2s        r�+test_issue16421_multiple_modules_in_one_dllz7ImportTests.test_issue16421_multiple_modules_in_one_dll�sG��
"��),����);�);�&���;��
�
��������8�,�,����� 9�8�D�D����� 9�8�D�D��������*�*�*������(A�B�B�B������(A�B�B�B�
�
�
�{�
+�
+�	6�	6����]�H�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s�1D�D�!Dc�(�d}d}|�t��5}t�||��ddd��n#1swxYwY|�||jj��|�||jj��dS)Nzbogus file path�	extension)	rCr�rr
�assertIn�	exceptionr@r�name)rr@r��errs    r�"test_load_dynamic_ImportError_pathz.ImportTests.test_load_dynamic_ImportError_paths���
!����
�
�
�{�
+�
+�	)�s����T�4�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)��
�
�d�C�M�.�/�/�/�����s�}�1�2�2�2�2�2s�A�A�Ac��d}t�|��}|d�|d���|ddtjkr|�d��tj|dg|dd��R�dS)Nr�rrvz/found module doesn't appear to be a C extensionrt)rr>r^�C_EXTENSIONr|r�)rr��founds   r�'test_load_module_extension_file_is_Nonez3ImportTests.test_load_module_extension_file_is_Nones���
%������%�%����8���!�H�N�N������8�A�;�#�/�)�)��M�M�K�L�L�L����d�/�U�1�2�2�Y�/�/�/�/�/�/rc��d}	tj|=n#t$rYnwxYw	tj|��}tj�d��}t�||j	��}|�
|j|��|�
|jj
|��|�
|jj	|j	��|�tt |d��|�
|jd��|�tj||��	tj|=dS#t$rYdSwxYw#	tj|=w#t$rYwwxYwxYw)Nztest.imp_dummy�_testmultiphase�
dummy_namei�)rZ�modules�KeyErrorr.r/�util�	find_specrr
�originrr&�__spec__r�rC�AttributeErrorr�	int_constr�)rr��module�specs    r�3test_issue24748_load_module_skips_sys_modules_checkz?ImportTests.test_issue24748_load_module_skips_sys_modules_checks�����	���D�!�!���	�	�	��D�	����	��,�T�2�2�F��>�+�+�,=�>�>�D��%�%�d�D�K�8�8�F����V�_�d�3�3�3����V�_�1�4�8�8�8����V�_�3�T�[�A�A�A����n�g�v�|�L�L�L����V�-�t�4�4�4��M�M�#�+�d�+�V�4�4�4�
��K��%�%�%���
�
�
����
�����
��K��%�%���
�
�
���
������sN�
�
��DE�:
E	�	
E�E�E:�
E*�)E:�*
E7�4E:�6E7�7E:z*test meaningful only when writing bytecodec�
�tj��5tjdz}tj|��|�tdtjtjdg��ddd��dS#1swxYwYdS)NrUz
^No modulerT)	r�temp_cwd�TESTFNr?r��assertRaisesRegexr�rr>)r�sources  r�test_bug7732zImportTests.test_bug77322s����
�
!�
!�	:�	:��%��-�F��H�V�����"�"�;�����!1�C�5�
:�
:�
:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s�AA8�8A<�?A<c��t�dtjttjd�����}|�tj��|�tj��dS)NrrJrW)r�_LoadSourceCompatibilityrBr\�get_data)r�loaders  r�test_multiple_calls_to_get_dataz+ImportTests.test_multiple_calls_to_get_data;s_���-�-�e�S�\�.2�3�<�'�.R�.R�.R�T�T�������%�%�%������%�%�%�%�%rc��dt��}ttjt��|��}t	jtj||��5|�td��5t�	|tdz��ddd��n#1swxYwYddd��dS#1swxYwYdS)N�tmpz
embedded null�)r&�typerZr�r�	swap_itemr��
ValueErrorrr�rB)rr7r3s   r�test_load_sourcezImportTests.test_load_sourceBs-��#��"�"��)�d�3�;�x�(�)�)�'�2�2��
�
�s�{�G�S�
9�
9�	:�	:��'�'�
�O�D�D�
:�
:������D��9�9�9�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:����
:�
:�
:�
:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s6�B<�4$B$�B<�$B(	�(B<�+B(	�,B<�<C�Cc���tjtd��}Gd�d��}|�t��5||����ddd��dS#1swxYwYdS)N�create_dynamicc��eZdZdZdZdS)�,ImportTests.test_issue31315.<locals>.BadSpecN�foo)r&r'r(r�r�r*rr�BadSpecr�Ps�������D��F�F�Frr�)r�
get_attributerrC�	TypeError)rr�r�s   r�test_issue31315zImportTests.test_issue31315Ks���!�.�s�4D�E�E��	�	�	�	�	�	�	�	��
�
�y�
)�
)�	&�	&��N�7�7�9�9�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	&�	&s�A#�#A'�*A'c��ddl}|�|jjd��ddl}|�|jjd��dS)Nr�frozen)�_frozen_importlib_externalrr�r��_frozen_importlib)rr�r�s   r�test_issue_35321zImportTests.test_issue_35321Vs\��
	*�)�)�)����3�<�C�X�N�N�N� � � � ����*�3�:�H�E�E�E�E�Erc��|�tjdd��d��|�tjdd��d��dS)N�*shis��G�$�~�+s�/�C�C��)r�_imp�source_hash)rs r�test_source_hashzImportTests.test_source_hashasP������)�"�e�4�4�6P�Q�Q�Q�����)�"�e�4�4�6P�Q�Q�Q�Q�Qrc���gdfddgdfddgdfddgdfg}|D]Z\}}|ddgz}tj|�}|�|j����d��|���[dS)N�defaultz--check-hash-based-pycs�always�neverz-cz.import _imp; print(_imp.check_hash_based_pycs)rJ)r�assert_python_okr�out�stripr})r�cases�interp_argsr�args�ress      r�'test_pyc_invalidation_mode_from_cmdlinez3ImportTests.test_pyc_invalidation_mode_from_cmdlinees���
��O�'��
3�Y�?�'��
2�H�=�'��
1�7�;�	
��&+�	H�	H�!�K����@�"��D� �0�$�7�C����S�W�]�]�_�_�3�3�G�<�<�h�G�G�G�G�
	H�	Hrc���tj��5tdd��5}|�d��ddd��n#1swxYwYt	jddtjj���t�	ddg���\}}}t�
d|||��}ddd��n#1swxYwY|�|jd	��dS)
Nzmymod.py�wbsx = 42
T)�doraise�invalidation_mode�mymodrT)r@r�)
rr�r\r]�
py_compile�compile�PycInvalidationMode�CHECKED_HASHrr>r�rr�)rrNrar@r�r3s      r�test_find_and_load_checked_pycz*ImportTests.test_find_and_load_checked_pyctsk��
�
�
!�
!�		D�		D��j�$�'�'�
&�2�����%�%�%�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&�����",�"@�"M�
�
�
�
�
'*�o�o�g�S�E�o�&J�&J�#�D�$���/�/�'�4��{�C�C�C�		D�		D�		D�		D�		D�		D�		D�		D�		D�		D�		D����		D�		D�		D�		D�	
������#�#�#�#�#s4�C�A�C�A	�C�A	�A'C�C�	Cc�����ddl�tjtd��}Gd�d��}|������fd�}|��tjd��}��|d��|��dS)Nr�create_builtinc��eZdZdZdS)�7ImportTests.test_create_builtin_subinterp.<locals>.Spec�builtinsN)r&r'r(r�r*rr�Specr�s�������D�D�Drrc���tj���}tj���}��|�����tj���|dz��t
j��dS)Nrt)rZ�getrefcountr�rr�r�gc�collect)�refcntr3rrr�s  ���r�check_get_builtinszEImportTests.test_create_builtin_subinterp.<locals>.check_get_builtins�si����_�X�.�.�F��%�d�+�+�C��M�M�#�x�(�(�(����S�_�X�6�6���
�C�C�C��J�L�L�L�L�Lrzimport builtins)rrr�r��run_in_subinterpr)rrrr�retrr�s`    @@r�test_create_builtin_subinterpz)ImportTests.test_create_builtin_subinterp�s������	���� �.�t�5E�F�F��	�	�	�	�	�	�	�	��t�v�v��	�	�	�	�	�	�	�	������&�'8�9�9������a� � � �������rN) r&r'r(r4r:rGrQrbr�r�r�rr�r�r�r�r�rr
rZr�r�r�r�rrr�r�r�rrr r*rrr,r,@s�������&�&�&�
0�0�0�7�7�7�L�L�L�&5�5�5�U,�U,�U,�nH�H�H�
=�=�=�*�	0�	0���	0��6�6���6��	3�	3���	3��
0�
0���
0�������,�X�_�S�,�4�6�6�:�:�6�6�:�&�&�&�:�:�:�
��&�&���&�	F�	F�	F�R�R�R�
H�
H�
H�$�$�$�
��������rr,c�*�eZdZdZd�Zd�Zd�Zd�ZdS)�ReloadTestszPVery basic tests to make sure that imp.reload() operates just like
    reload().c��tj��5ddl}t�|��ddd��dS#1swxYwYdS)Nr)rr�r?r�reload)rr?s  r�test_sourcezReloadTests.test_source�s����
*�
,�
,�	�	��I�I�I��J�J�r�N�N�N�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�A�A�Ac��tjd��5ddl}t�|��ddd��dS#1swxYwYdS)N�timer)rr�r'rr$)rr's  r�test_extensionzReloadTests.test_extension�s���
�
&�v�
.�
.�	�	��K�K�K��J�J�t����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��A�A�Ac��tjd��5ddl}t�|��ddd��dS#1swxYwYdS)N�marshalr)rr�r+rr$)rr+s  r�test_builtinzReloadTests.test_builtin�s���
�
&�y�
1�
1�	 �	 ��N�N�N��J�J�w����	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 �	 �	 r)c�"��ddlm}tj�d����fd�}|�|��|�td��5t�	|��ddd��dS#1swxYwYdS)Nr)�parser�htmlc�&���tjd<dS)Nr/)rZr�)r/s�r�cleanupz5ReloadTests.test_with_deleted_parent.<locals>.cleanup�s���"&�C�K����r)
r/r.rZr��popr�r�r�rr$)rr.r1r/s   @r�test_with_deleted_parentz$ReloadTests.test_with_deleted_parent�s�����������{���v�&�&��	'�	'�	'�	'�	'����� � � �
�
#�
#�K��
8�
8�	�	��J�J�v����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�B�B�BN)r&r'r(r)r%r(r,r3r*rrr"r"�sZ��������
�
�
����
 � � �
����rr"c���eZdZdZe���Zeje	j
jdud��d���Zeje	j
jdud��d���Z
dS)�PEP3147TestszTests of PEP 3147.Nz1requires sys.implementation.cache_tag not be Nonec	��tj�dddd��}tj�ddddd�|j����}|�t�|d��|��dS)Nr��bar�baz�qux.pyrx�
qux.{}.pycT)r?r@r~�format�tagrrr��rr@�expects   r�test_cache_from_sourcez#PEP3147Tests.test_cache_from_source�sy��
�w�|�|�E�5�%��:�:������e�U�E�=�*�1�1�$�(�;�;�=�=������.�.�t�T�:�:�F�C�C�C�C�Crz4requires sys.implementation.cache_tag to not be Nonec	��tj�ddddd�|j����}tj�dddd��}|�t�|��|��dS)Nr�r7r8rxr:r9)r?r@r~r;r<rr�source_from_cacher=s   r�test_source_from_cachez#PEP3147Tests.test_source_from_cache�sw���w�|�|�E�5�%��(�/�/���9�9�;�;������e�U�E�8�<�<������.�.�t�4�4�f�=�=�=�=�=r)r&r'r(r)r�get_tagr<r�
skipUnlessrZ�implementation�	cache_tagr?rBr*rrr5r5�s���������

�+�+�-�-�C��X���+�5�T�A�L�N�N�D�D�N�N�D��X���+�5�T�A� �!�!�>�>�!�!�>�>�>rr5c�P�eZdZejejdud��d���ZdS)�NullImporterTestsNzNeed an undecodeable filenamec���tj}tj|��	|�t
tj|��tj|��dS#tj|��wxYw)N)	r�TESTFN_UNENCODABLEr?r�rCr�r�NullImporter�rmdir)rr�s  r�test_unencodeablez#NullImporterTests.test_unencodeable�s\���+��
������	����k�3�+;�T�B�B�B��H�T�N�N�N�N�N��B�H�T�N�N�N�N���s�&A�A4)r&r'r(rr
rrJrMr*rrrHrH�sK�������X�_�Y�1�T�9�4�6�6���6�6���rrH�__main__)rr.�importlib.utilr?�os.pathr
rZr6r�test.supportrrrrrr��import_deprecatedrr�r@r&r�r�TestCaserr,r"r5rH�mainr*rr�<module>rUs��	�	�	�	���������	�	�	�	���������
�
�
�
�������&�&�&�&�&�&�"�"�"�"�"�"�&�&�&�&�&�&�(�(�(�(�(�(���������'�o�'��.�.�������w���@�@�@� ,� ,� ,� ,� ,��!� ,� ,� ,�D]�]�]�]�]�(�#�]�]�]�@#�#�#�#�#�(�#�#�#�#�L>�>�>�>�>�8�$�>�>�>�6	�	�	�	�	��)�	�	�	��z����H�M�O�O�O�O�O��r