Current File : //lib/python3/dist-packages/twisted/trial/test/__pycache__/test_loader.cpython-312.pyc |
�
Ϫ�f�_ � �� � d Z ddlmZ ddlZddlZddlZddlmZ ddl m
Z
ddlmZ ddl
mZmZmZ ddlmZmZmZ dd lmZ dd
lmZmZ ddlmZmZmZ ddlmZ dd
l m!Z!m"Z"mZ ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* erddl+m,Z, d d�Z- G d� de(j\ � Z/d!d�Z0 G d� de(j\ � Z1 G d� de(j\ � Z2 G d� de2� Z3 G d� de(j\ � Z4y)"z"
Tests for loading tests by name.
� )�annotationsN)�md5)�
attrgetter)�
ModuleType)�
TYPE_CHECKING�Callable� Generator)�assert_that�equal_to�has_properties)�Matcher)�filepath�util)�PythonAttribute�PythonModule� getModule)�ModuleNotFound)�reporter�runner�unittest)�
_iterateTests)� ITestCase)�packages� )�after)�SupportsRichComparisonc �h � g }t | � D ]! }|j |j � � �# |S )zI
Return the id of each test within the given test suite or case.
)r �append�id)�tests�names�tests �@/usr/lib/python3/dist-packages/twisted/trial/test/test_loader.py� testNamesr$ ! s4 � �
�E��e�$� ��
���T�W�W�Y�� ��L� c �@ � � e Zd Zd� fd�Zdd�Zdd�Zdd�Zdd�Z� xZS )�FinderPy3Testsc �T �� t �| � � t j � | _ y �N)�super�setUpr �
TestLoader�loader)�self� __class__s �r# r+ zFinderPy3Tests.setUp, s �� �
��
���'�'�)��r% c �Z � | j t | j j d� y)z�
findByName, if given something findable up until the last entry, will
raise AttributeError (as it cannot tell if 'nonexistent' here is
supposed to be a module or a class).
ztwisted.trial.test.nonexistentN)�assertRaises�AttributeErrorr- �
findByName�r. s r# �test_findNonModulez!FinderPy3Tests.test_findNonModule0 s$ � �
����D�K�K�2�2�4T�
r% c �Z � | j t | j j d� y )N� nonextant)r1 r r- r3 r4 s r# �test_findNonPackagez"FinderPy3Tests.test_findNonPackage: s � ����.�$�+�+�*@�*@�+�Nr% c � � t j t d� }| j t | j
j |� y)z�
findByName, given a file path that doesn't exist, will raise a
ValueError saying that it is not a Python file.
znonexistent.pyN)r �sibpath�__file__r1 �
ValueErrorr- r3 )r. �paths r# �test_findNonFilezFinderPy3Tests.test_findNonFile= s1 � �
�|�|�H�&6�7�����*�d�k�k�&<�&<�d�Cr% c �Z � | j t | j j d� y)zn
findByName will re-raise ImportErrors inside modules that it has found
and imported.
zunimportablepackage.test_moduleN)r1 �ImportErrorr- r3 r4 s r# �test_findFileWithImportErrorz+FinderPy3Tests.test_findFileWithImportErrorE s$ � �
�������/�/�1R�
r% ��return�None) �__name__�
__module__�__qualname__r+ r5 r8 r>