Sindbad~EG File Manager
�
)Μg� � �: � d dl Z d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dlm Z d dl
mZ G d� d� Z G d� dej � Z G d � d
ej ej � Z G d� dej � Zed
k( r ej( � yy)� N)�abc)�util)�threading_helperc � � e Zd Zd� Zd� Zy)�CollectInitc � � || _ || _ y �N)�args�kwargs)�selfr
r s �:/usr/local/lib/python3.12/test/test_importlib/test_lazy.py�__init__zCollectInit.__init__ s � ��� ���� c � � | S r � �r �modules r
�exec_modulezCollectInit.exec_module s � ��r N)�__name__�
__module__�__qualname__r r r r r
r r s � ��r r c � � e Zd Zd� Zd� Zy)�LazyLoaderFactoryTestsc �� � t j j t � } |ddd�� }|j }| j d|j � | j ddi|j � y )N�module name�module path�kw)r )r r )r �
LazyLoader�factoryr �loader�assertEqualr
r )r r �lazy_loaderr s r
� test_initz LazyLoaderFactoryTests.test_init s^ � ��/�/�)�)�+�6�� �m�]�t�D���#�#�����7����E����$���v�}�}�5r c � � | j t � 5 t j j t
� d d d � y # 1 sw Y y xY wr )�assertRaises� TypeErrorr r r �object�r s r
�test_validationz&LazyLoaderFactoryTests.test_validation# s. � �
�
�
�y�
)��O�O�#�#�F�+� *�
)�
)�s �$A�AN)r r r r# r) r r r
r r s � �6�,r r c �L � e Zd ZdZdZdZdZdj e� Zdd�Z d� Z
y) �TestingImporter�lazy_loader_test�changedNr zattr = 42; __name__ = {!r}c �t � || j k7 ry t j |t j | � � S r )�module_namer �spec_from_loaderr )r �name�path�targets r
� find_speczTestingImporter.find_spec1 s/ � ��4�#�#�#���$�$�T�4�?�?�4�+@�A�Ar c � � t j d� t | j |j � || _ | xj dz
c_ y )Ng{�G�z�?� )�time�sleep�exec�source_code�__dict__�loaded�
load_countr s r
r zTestingImporter.exec_module6 s7 � ��
�
�4���T�
�
�v���/�������1��r r )r r r r/ �mutated_namer<