o 3a@sTddlZddlmZddlmZddlmZddlmZm Z m Z GdddeZ dS)N)settings) BaseCommand)get_command_line_option)NullTimeKeeper TimeKeeper get_runnercs8eZdZdZgZdZfddZddZddZZ S) CommandzIDiscover and run tests in the specified modules or the current directory.Ncst|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_runnersuper run_from_argv)selfargv __class__F/usr/lib/python3/dist-packages/django/core/management/commands/test.pyr s zCommand.run_from_argvcCsl|jddddd|jdddd d d |jd d dd|jdddtt|j}t|dr4||dSdS)Nargs test_label*z_Module paths to test; can be modulename, modulename.TestCase or modulename.TestCase.test_method)metavarnargshelpz --noinputz --no-input store_false interactivez:Tells Django to NOT prompt the user for input of any kind.)actiondestrz --failfast store_truezDTells Django to stop running the test suite after first failed test.)rrr zhTells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting.)r add_arguments) add_argumentrrr hasattrr)r parsertest_runner_classrrrrs(  zCommand.add_argumentscOstt|d}|ddrtnt}|di|}|d ||}Wdn1s/wY||rAt ddSdS)N testrunnertimingFz Total runr) rrgetrrtimed run_tests print_resultssysexit)r test_labelsoptions TestRunner time_keeperr failuresrrrhandle1s  zCommand.handle) __name__ __module__ __qualname__rrequires_system_checksr r rr1 __classcell__rrrrr s  r) r* django.confrdjango.core.management.baserdjango.core.management.utilsrdjango.test.utilsrrrrrrrrs