
    Vh?	                     f    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e      Zy)	    N)settings)BaseCommand)get_command_line_option)get_max_test_processes)NullTimeKeeper
TimeKeeper
get_runnerc                   6     e Zd ZdZg ZdZ fdZd Zd Z xZ	S )CommandzIDiscover and run tests in the specified modules or the current directory.Nc                 F    t        |d      | _        t        |   |       y)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__s     T/home/dcms/DCMS/lib/python3.12/site-packages/django/core/management/commands/test.pyr   zCommand.run_from_argv   s!     34Hd#    c                     |j                  dddd       |j                  dddd	d
       |j                  dd       t        t        | j                        }t	        |d      r|j                  |       y y )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   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_classs      r   r!   zCommand.add_arguments   s     2 	 	
 	 M 	 	
 	< 	 	
 'x1A1AB$o6++F3 7r   c                    t        t        |d         }|j                  dd      r
t               n	t	               }|j                  d      }|dk(  rt               |d<    |di |}|j                  d      5  |j                  |      }d d d        |j                          rt        j                  d       y y # 1 sw Y   2xY w)	N
testrunnertimingFparallelautoz	Total run    )r	   r   getr   r   r   timed	run_testsprint_resultssysexit)r   test_labelsoptions
TestRunnertime_keeperr)   r   failuress           r   handlezCommand.handle6   s    ',*?@
&-kk(E&BjlHX;;z*v"8":GJ +7+{+ 	:",,[9H	:!!#HHQK 	: 	:s   6B99C)
__name__
__module____qualname__r   requires_system_checksr   r   r!   r8   __classcell__)r   s   @r   r   r   
   s$    VD  K$48r   r   )r1   django.confr   django.core.management.baser   django.core.management.utilsr   django.test.runnerr   django.test.utilsr   r   r	   r   r,   r   r   <module>rC      s&    
   3 @ 5 D D8k 8r   