File: //usr/lib/python3/dist-packages/django/core/management/commands/__pycache__/test.cpython-310.pyc
o
3�a� � @ sT d dl Z d dlmZ d dlmZ d dlmZ d dlmZm Z m
Z
G dd� de�ZdS )� N)�settings)�BaseCommand)�get_command_line_option)�NullTimeKeeper�
TimeKeeper�
get_runnerc s8 e Zd ZdZg ZdZ� fdd�Zdd� Zdd� Z� Z S ) �CommandzIDiscover and run tests in the specified modules or the current directory.Nc s t |d�| _t� �|� dS )z�
Pre-parse the command line to extract the value of the --testrunner
option. This allows a test runner to define additional command line
arguments.
�--testrunnerN)r �test_runner�super�
run_from_argv)�self�argv�� __class__� �F/usr/lib/python3/dist-packages/django/core/management/commands/test.pyr s zCommand.run_from_argvc C sl |j ddddd� |j dddd d
d� |j dd
dd� |j ddd� tt| j�}t|d�r4|�|� d S d S )N�args�
test_label�*z_Module paths to test; can be modulename, modulename.TestCase or modulename.TestCase.test_method)�metavar�nargs�helpz --noinputz
--no-input�store_false�interactivez:Tells Django to NOT prompt the user for input of any kind.)�action�destr z
--failfast�
store_truezDTells Django to stop running the test suite after first failed test.)r r r zhTells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting.)r �
add_arguments)�add_argumentr r r
�hasattrr )r
�parser�test_runner_classr r r r s( ����
�zCommand.add_argumentsc O s� t t|d �}|�dd�rt� nt� }|di |��}|�d��
|�|�}W d � n1 s/w Y |�� |rAt� d� d S d S )N�
testrunner�timingFz Total run� r )
r r �getr r �timed� run_tests�
print_results�sys�exit)r
�test_labels�options�
TestRunner�time_keeperr
�failuresr r r �handle1 s ��zCommand.handle)
�__name__�
__module__�__qualname__r �requires_system_checksr
r r r1 �
__classcell__r r r r r s r )r* �django.confr �django.core.management.baser �django.core.management.utilsr �django.test.utilsr r r r r r r r �<module> s