a
    [f	                     @   s`   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
mZmZ G dd deZdS )	    N)settings)BaseCommand)get_command_line_option)get_max_test_processes)NullTimeKeeper
TimeKeeper
get_runnerc                       s8   e Zd ZdZg 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.Nc                    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.
        --testrunnerN)r   test_runnersuperrun_from_argv)selfargv	__class__ vC:\Users\91910\OneDrive\Desktop\vts_admin_rebuild-master\vts\Lib\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   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   parserZtest_runner_classr   r   r   r      s2    	
zCommand.add_argumentsc                 O   s   t t|d }|ddr t nt }|d}|dkrBt |d< |f i |}|d ||}W d    n1 sz0    Y  |  |rt	
d d S )NZ
testrunnerZtimingFparallelautoz	Total run   )r   r   getr   r   r   Ztimed	run_testsprint_resultssysexit)r   Ztest_labelsoptionsZ
TestRunnerZtime_keeperr"   r   Zfailuresr   r   r   handle;   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.runnerr   Zdjango.test.utilsr   r   r   r	   r   r   r   r   <module>   s   