a zeo @shdZddlZddlZejjdkr*edGdddeZGdddejZ dd l Te d krde dS) uA 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: ЉЊЈЁЂ NzCannot test docstrings with -O2c@sfeZdZdZddZddZGdddeZdd Zd d Z e ee d d Z e ddZ eddZdS)CuClass C. >>> print(C()) # 2 42 We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ cCsdS)z;C.__init__. >>> print(C()) # 3 42 NselfrrF/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_doctest2.py__init__!sz C.__init__cCsdS)z/ >>> print(C()) # 4 42 Z42rrrrr__str__(sz C.__str__c@seZdZdZddZdS)zC.DzJA nested D class. >>> print("In D!") # 5 In D! cCsdS)z8 >>> print(3) # 6 3 Nrrrrrnested6sz C.D.nestedN)__name__ __module__ __qualname____doc__r rrrrD/srcCs|j S)zg >>> c = C() # 7 >>> c.x = 12 # 8 >>> print(c.x) # 9 -12 Z_xrrrrgetx<szC.getxcCs ||_dS)zm >>> c = C() # 10 >>> c.x = 12 # 11 >>> print(c.x) # 12 -12 Nr)rvaluerrrsetxEszC.setxzi >>> c = C() # 13 >>> c.x = 12 # 14 >>> print(c.x) # 15 -12 )doccCsdS)z A static method. >>> print(C.statm()) # 16 666 >>> print(C().statm()) # 17 666 irrrrrstatmUs zC.statmcCs|S)z A class method. >>> print(C.clsm(22)) # 18 22 >>> print(C().clsm(23)) # 19 23 r)clsvalrrrclsmas zC.clsmN)r r r rrr objectrrrpropertyx staticmethodr classmethodrrrrrrs     rc@seZdZddZdS)TestcCs\ddl}ddl}d}||jt\}}|r>|d||f||krX|d||fdS)Nrz%d of %d doctests failedz expected %d tests to run, not %d)doctestsystestmodmodulesr Zfail)rr r!ZEXPECTEDftrrr test_testmodoszTest.test_testmodN)r r r r&rrrrrnsr)*__main__) rr!ZunittestflagsoptimizeZSkipTestrrZTestCaserr r mainrrrrs   [