�
_�d� � �� � d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m
Z
d dlmZ d dlm
Z
mZmZmZmZmZmZ ddlmZ d dlmZ d d lmZ d d
lmZ G d� de� Z G d
� d� Z G d� de� Zy)� N)�DistutilsError�DistutilsOptionError)�log)�
TestLoader)�resource_listdir�resource_exists�normalize_path�working_set�evaluate_marker�add_activation_listener�require� )�metadata)�Command)�unique_everseen)� pass_nonec � � e Zd Zd� Zdd�Zy)�ScanningLoaderc �L � t j | � t � | _ y �N)r �__init__�set�_visited��selfs �9/usr/lib/python3/dist-packages/setuptools/command/test.pyr zScanningLoader.__init__ s � ����D�!����
� Nc � � || j v ry| j j |� g }|j t j | |� � t |d� r|j |j
� � t |d� r�t |j d� D ]{ }|j d� r|dk7 r|j dz |dd z }n-t |j |d z � r|j dz |z }n�\|j | j |� � �} t |� d
k7 r| j |� S |d S )a Return a suite of all tests cases contained in the given module
If the module is a package, load tests from all the modules in it.
If the module has an ``additional_tests`` function, call it and add
the return value to the tests.
N�additional_tests�__path__� z.pyz__init__.py�.���z/__init__.py� r )r �add�appendr �loadTestsFromModule�hasattrr r �__name__�endswithr �loadTestsFromName�len�
suiteClass)r �module�pattern�tests�file� submodules r r' |