관리-도구
편집 파일: main.cpython-38.pyc
U i�f�+ � @ st d Z ddlZddlZddlZddlmZmZ ddlmZ dZ dZ dZd d � Zdd� Z d d� ZG dd� de�ZeZdS )zUnittest main program� N� )�loader�runner)�installHandlerTa Examples: %(prog)s test_module - run tests from test_module %(prog)s module.TestClass - run tests from module.TestClass %(prog)s module.Class.test_method - run specified test method %(prog)s path/to/test_file.py - run tests from test_file.py aF Examples: %(prog)s - run default set of tests %(prog)s MyTestSuite - run suite 'MyTestSuite' %(prog)s MyTestCase.testSomething - run MyTestCase.testSomething %(prog)s MyTestCase - run all 'test*' test methods in MyTestCase c C sx t j�| �rt| �� �d�rtt j�| �rXt j�| t �� �}t j�|�sP|�t j �rT| S |} | d d� � dd�� dd�S | S )Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd� startswith�pardir�replace)�nameZrel_path� r �2/opt/alt/python38/lib64/python3.8/unittest/main.py� _convert_name s r c C s dd� | D �S )Nc S s g | ]}t |��qS r )r )�.0r r r r � <listcomp>. s z"_convert_names.<locals>.<listcomp>r )�namesr r r �_convert_names- s r c C s d| krd| } | S )N�*z*%s*r )�patternr r r �_convert_select_pattern1 s r c @ s� e Zd ZdZdZdZd Z Z Z Z Z ZdZdddde jddddddfdd�dd �Zdd d�Zdd � Zdd� Zddd�Zdd� Zdd� Zdd� Zdd� Zd dd�Zdd� ZdS )!�TestProgramzA command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. Nr �__main__TF)� tb_localsc C s� t |t�r<t|�| _|�d�dd � D ]} t| j| �| _q&n|| _|d krPtj}|| _|| _ | | _ || _| | _|| _ |d kr�tjs�d| _n|| _|| _|| _|| _tj�|d �| _| �|� | �� d S )Nr r �defaultr )� isinstance�str� __import__�module�split�getattr�sys�argv�exit�failfast� catchbreak� verbosity�bufferr"