ó
…¾^Yc           @   s\   d  Z  y d d l Z Wn e k
 r5 d d l Z n Xd „  Z d e j f d „  ƒ  YZ d S(   s5   Implementations of unittest features from the future.iÿÿÿÿNc         C   s   t  t j |  ƒ S(   s/   Does `unittest.TestCase` have `method` defined?(   t   hasattrt   unittestt   TestCase(   t   method(    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyt   unittest_has   s    R   c           B   sG   e  Z d  Z d „  Z e d ƒ s- d „  Z n  e d ƒ sE d „  Z n  RS(   s²   Just like unittest.TestCase, but with assert methods added.

    Designed to be compatible with 3.1 unittest.  Methods are only defined if
    `unittest` doesn't have them.

    c         C   s    |  j  t | ƒ t | ƒ ƒ d S(   s9   Assert these have the same elements, regardless of order.N(   t   assertEqualt   sorted(   t   selft   s1t   s2(    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyt   assertCountEqual    s    t   assertRaisesRegexc         O   s   |  j  | | Ž  S(   N(   t   assertRaisesRegexp(   R   t   argst   kwargs(    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyR   %   s    t   assertRegexc         O   s   |  j  | | Ž  S(   N(   t   assertRegexpMatches(   R   R   R   (    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyR   )   s    (   t   __name__t
   __module__t   __doc__R
   R   R   R   (    (    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyR      s   	(   R   t	   unittest2R   t   ImportErrorR   R   (    (    (    s7   /tmp/pip-build-hU8Cw8/coverage/coverage/backunittest.pyt   <module>   s   	