ó
®â0_c           @   sV   d  d l  Z  d  d l m Z d  d l m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   settings(   t   BaseCommand(   t
   get_runnert   Commandc           B   s8   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z RS(   sI   Discover and run tests in the specified modules or the current directory.c         C   s    d  |  _ t t |  ƒ j ƒ  d  S(   N(   t   Nonet   test_runnert   superR   t   __init__(   t   self(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyR      s    	c         C   s[   d } x8 | d D], } | j  | ƒ r | t | ƒ |  _ Pq q Wt t |  ƒ j | ƒ d S(   s´   
        Pre-parse the command line to extract the value of the --testrunner
        option. This allows a test runner to define additional command line
        arguments.
        s   --testrunner=i   N(   t
   startswitht   lenR   R   R   t   run_from_argv(   R   t   argvt   optiont   arg(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyR      s    c         C   sÀ   | j  d d d d d d d ƒ| j  d d	 d
 d d d d t d d ƒ| j  d d
 d d d d t d d ƒ| j  d d
 d d d d d ƒt t |  j ƒ } t | d ƒ r¼ | j | ƒ n  d  S(   Nt   argst   metavart
   test_labelt   nargst   *t   helps_   Module paths to test; can be modulename, modulename.TestCase or modulename.TestCase.test_methods	   --noinputs
   --no-inputt   actiont   store_falset   destt   interactivet   defaults:   Tells Django to NOT prompt the user for input of any kind.s
   --failfastt
   store_truet   failfastsD   Tells Django to stop running the test suite after first failed test.s   --testrunnert   storet
   testrunnersh   Tells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting.t   add_arguments(   t   add_argumentt   Truet   FalseR   R    R   t   hasattrR   (   R   t   parsert   test_runner_class(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyR      s    c         O   sh   d d l  m } d d l m } | | | d ƒ } | |   } | j | ƒ } | rd t j d ƒ n  d  S(   Niÿÿÿÿ(   R    (   R   R   i   (   t   django.confR    t   django.test.utilsR   t	   run_testst   syst   exit(   R   t   test_labelst   optionsR    R   t
   TestRunnerR   t   failures(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyt   handle7   s    (	   t   __name__t
   __module__R   R!   t   requires_system_checksR   R   R   R.   (    (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyR      s   			(   R(   R%   R    t   django.core.management.baseR   R&   R   R   (    (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/test.pyt   <module>   s   