a
    Lcò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__© úa/home/httpd/docs/test/DocsMgr/lib/python3.9/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  | ¡  |ršt	 
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   