B
    `                 @   sL   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ G dd deZ	dS )    N)settings)BaseCommand)get_command_line_option)
get_runnerc                   s8   e Zd ZdZdZdZ fddZdd Zdd	 Z  Z	S )
CommandzIDiscover and run tests in the specified modules or the current directory.FNc                s   t |d| _t | dS )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.
        z--testrunnerN)r   test_runnersuperrun_from_argv)selfargv)	__class__ S/home/dcms/DCMS/lib/python3.7/site-packages/django/core/management/commands/test.pyr	      s    zCommand.run_from_argvc             C   sh   |j ddddd |j dddd	d
d |j dddd |j ddd tt| j}t|drd|| d S )NargsZ
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   z--testrunnerzhTells 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
   parserZtest_runner_classr   r   r   r      s    
zCommand.add_argumentsc             O   s4   t t|d }|f |}||}|r0td d S )NZ
testrunner   )r   r   Z	run_testssysexit)r
   Ztest_labelsoptionsZ
TestRunnerr   Zfailuresr   r   r   handle1   s
    

zCommand.handle)
__name__
__module____qualname__r   Zrequires_system_checksr   r	   r   r!   __classcell__r   r   )r   r   r   	   s   	r   )
r   Zdjango.confr   Zdjango.core.management.baser   Zdjango.core.management.utilsr   Zdjango.test.utilsr   r   r   r   r   r   <module>   s
   