ó
d¦Uc           @   sV   d  Z  d d l m Z d d l m Z m Z d d l m Z d e f d „  ƒ  YZ d S(   s0  
This plugin provides assert introspection. When the plugin is enabled
and a test failure occurs, the traceback is displayed with extra context
around the line in which the exception was raised. Simple variable 
substitution is also performed in the context output to provide more
debugging information.
iÿÿÿÿ(   t   Plugin(   t   exc_to_unicodet   force_unicode(   t   inspect_tracebackt   FailureDetailc           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   sP   
    Plugin that provides extra information in tracebacks of test failures.
    i@  c         C   s8   | j  d d d d d d | j d ƒ d d	 d
 d ƒd S(   s'   Register commmandline options.
        s   -ds   --detailed-errorss   --failure-detailt   actiont
   store_truet   defaultt   NOSE_DETAILED_ERRORSt   destt   detailedErrorst   helpsZ   Add detail to error output by attempting to evaluate failed asserts [NOSE_DETAILED_ERRORS]N(   t
   add_optiont   get(   t   selft   parsert   env(    (    s9   lib/python2.7/site-packages/nose/plugins/failuredetail.pyt   options   s
    c         C   s&   |  j  s d S| j |  _ | |  _ d S(   s   Configure plugin.
        N(   t   can_configureR
   t   enabledt   conf(   R   R   R   (    (    s9   lib/python2.7/site-packages/nose/plugins/failuredetail.pyt	   configure   s    	c         C   sh   | \ } } } d t | ƒ } } | rR t t | ƒ ƒ } d j | | g ƒ } n  | | _ | | | f S(   sL   Add detail from traceback inspection to error message of a failure.
        s   
N(   t   NoneR   R   R   t   joint   tbinfo(   R   t   testt   errt   ect   evt   tbR   t   str_ev(    (    s9   lib/python2.7/site-packages/nose/plugins/failuredetail.pyt   formatFailure&   s    	(   t   __name__t
   __module__t   __doc__t   scoreR   R   R   (    (    (    s9   lib/python2.7/site-packages/nose/plugins/failuredetail.pyR      s
   		N(	   R"   t   nose.pluginsR    t   nose.pyversionR   R   t   nose.inspectorR   R   (    (    (    s9   lib/python2.7/site-packages/nose/plugins/failuredetail.pyt   <module>   s   