ó
ŠwÛjc           @   s•   d  Z  d d l Z d d l Z d d l m Z e j j d k rR e j d ƒ ‚ n  d e f d „  ƒ  YZ	 d „  Z
 d d	 l Te d
 k r‘ e
 ƒ  n  d S(   uð   A module to test whether doctest recognizes some 2.2 features,
like static and class methods.

>>> print 'yup'  # 1
yup

We include some (random) encoded (utf-8) text in the text surrounding
the example.  It should be ignored:

Ð‰ÐŠÐˆÐ�Ð‚

iÿÿÿÿN(   t   test_supporti   s   Cannot test docstrings with -O2t   Cc           B   s{   e  Z d  Z d „  Z d „  Z d e f d „  ƒ  YZ d „  Z d „  Z e	 e e d d ƒZ
 e d	 „  ƒ Z e d
 „  ƒ Z RS(   uµ   Class C.

    >>> print C()  # 2
    42


    We include some (random) encoded (utf-8) text in the text surrounding
    the example.  It should be ignored:

        Ð‰ÐŠÐˆÐ�Ð‚

    c         C   s   d S(   s:   C.__init__.

        >>> print C() # 3
        42
        N(    (   t   self(    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   __init__#   t    c         C   s   d S(   s.   
        >>> print C() # 4
        42
        t   42(    (   R   (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   __str__*   s    t   Dc           B   s   e  Z d  Z d „  Z RS(   sI   A nested D class.

        >>> print "In D!"   # 5
        In D!
        c         C   s   d S(   s7   
            >>> print 3 # 6
            3
            N(    (   R   (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   nested8   R   (   t   __name__t
   __module__t   __doc__R   (    (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyR   1   s   c         C   s   |  j  S(   sf   
        >>> c = C()    # 7
        >>> c.x = 12   # 8
        >>> print c.x  # 9
        -12
        (   t   _x(   R   (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   getx>   s    c         C   s   | |  _  d S(   sl   
        >>> c = C()     # 10
        >>> c.x = 12    # 11
        >>> print c.x   # 12
        -12
        N(   R   (   R   t   value(    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   setxG   s    t   docsh           >>> c = C()    # 13
        >>> c.x = 12   # 14
        >>> print c.x  # 15
        -12
        c           C   s   d S(   sƒ   
        A static method.

        >>> print C.statm()    # 16
        666
        >>> print C().statm()  # 17
        666
        iš  (    (    (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   statmW   s    
c         C   s   | S(   s‚   
        A class method.

        >>> print C.clsm(22)    # 18
        22
        >>> print C().clsm(23)  # 19
        23
        (    (   t   clst   val(    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   clsmc   s    
(   R	   R
   R   R   R   t   objectR   R   R   t   propertyt   xt   staticmethodR   t   classmethodR   (    (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyR      s   							c          C   sW   d d l  m }  d } t j |  ƒ \ } } | | k rS t j d | | f ƒ ‚ n  d  S(   Niÿÿÿÿ(   t   test_doctest2i   s    expected %d tests to run, not %d(   t   testR   R    t   run_doctestt
   TestFailed(   R   t   EXPECTEDt   ft   t(    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt	   test_maino   s    	(   t   *t   __main__(   R   t   syst   unittestR   R    t   flagst   optimizet   SkipTestR   R   R!   t   doctestR	   (    (    (    sˆ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_doctest2.pyt   <module>   s   Z	

