관리-도구
편집 파일: loader.cpython-38.pyc
U )�e�c � @ sD d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m Z ddlmZm Z ddlmZ ddlmZ ddlmZmZmZ dd lmZmZ dd lmZmZmZmZmZmZm Z m!Z!m"Z"m#Z# ddl$m%Z%m&Z&m'Z' ddlm(Z(m)Z) ddl*Z*e�+e,�Z-ej.j/Z0ej.j1Z2ej.j3Z4ej.j5Z6ej.j7Z8d dgZ9G dd � d ej:�Z:e:Z;dS )z� Test Loader ----------- nose's test loader implements the same basic functionality as its superclass, unittest.TestLoader, but extends it by more liberal interpretations of what may be a test and how a test may be named. � N)� isfunction)�unbound_method�ismethod)�FunctionTestCase�MethodTestCase)�Failure)�Config)�Importer�add_path�remove_path)�defaultSelector�TestAddress) �func_lineno� getpackage�isclass�isgenerator� ispackage�regex_last_key�resolve_name�transplant_func�transplant_class�test_address)�ContextSuiteFactory�ContextList� LazySuite)� sort_list� cmp_to_key� TestLoader�defaultTestLoaderc s� e Zd ZdZdZdZdZdZdZd&dd�Z dd� Z dd� Zd d � Zdd� Z d d� Zdd� Zdd� Zd'dd�Zd(dd�Zd)dd�Z� fdd�Zdd� Zd*dd�Zd+d d!�Zd"d#� Zd$d%� Z� ZS ),r aA Test loader that extends unittest.TestLoader to: * Load tests from test-like functions and classes that are not unittest.TestCase subclasses * Find and load test modules in a directory * Support tests that are generators * Support easy extensions of or changes to that behavior through plugins Nc C s� |dkrt � }|dkr t|d�}|dkr.|j}|dkr@t|�}nt|�rP||�}|| _|| _tt|��| _|| _ |j r�t||� t|d�| _ tg �| _tj�| � dS )a Initialize a test loader. Parameters (all optional): * config: provide a `nose.config.Config`_ or other config class instance; if not provided a `nose.config.Config`_ with default values is used. * importer: provide an importer instance that implements `importFromPath`. If not provided, a `nose.importer.Importer`_ is used. * workingDir: the directory to which file and module names are relative. If not provided, assumed to be the current working directory. * selector: a selector class or instance. If a class is provided, it will be instantiated with one argument, the current config. If not provided, a `nose.selector.Selector`_ is used. N)�config)r r � workingDirr r r �importer�op_normpath� op_abspath�selector�addPathsr r � suiteClass�set� _visitedPaths�unittestr �__init__)�selfr r! r r$ � r, �9/opt/hc_python/lib/python3.8/site-packages/nose/loader.pyr* <