+
    WBip                         R t ^ RIt^ RIHt ^ RIHtHt ^ RIHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^R	IHt  ! R
 R]P*                  4      t]R8X  d   ^ RIHt ]! 4        R# R# )zp
Tests the doxypypy filter.

These tests may all be executed by running tox from the
root level of the project.
N)	Namespace)linesepsep)basenamesplitext)parse)open)version_info)mark)	AstWalkerc                     a  ] tR t^t o RtRt]! RRRRR^RRRRR7
      tR],           R	],           .t	]P                  ! R
R.4      tRRRRRRRRR./RRRRRRRRR./RRRRRRR. R^O/RRRRRRR. R_O/RRRRRRR. R`O/RR RRRR!R. RaO/.tRR"RRRR#R. RbO/RR$RRRR%R. RcO/RR&RRRR'R. RdO/.tRR(RRRR)R. ReO/RR*RRRR+R. RfO/.tRR,RRRR-R. RgO/RR.RRRR/R. RhO/.tRR0RRRR1R. RiO/RR2RRRR3R. RjO/RR4RRRR5R. RkO/RR6RRRR7R. RlO/.tR8t R9 tR: tR; tR< tR= tR> tR? tR@ tRA tRB tRC tRD tRE tRF tRG t ]!RmRH l4       t"RnRI lt#RJ t$]%PL                  ! ]'Ro8  RKRL7      RM 4       t(RN t)RO t*RP t+RQ t,RR t-RS t.RT t/RU t0RV t1RW t2RX t3]%PL                  ! ]'Ro8  RYRL7      RZ 4       t4]%PL                  ! ]'Ro8  RYRL7      R[ 4       t5]%PL                  ! ]'Ro8  RYRL7      R\ 4       t6R]t7V t8R# )pTestDoxypypyz
Define our doxypypy tests.
NTFdummyzdummy.py
	autobriefautocodedebugfullPathNamespacetopLevelNamespace	tablengthfilenameobject_respectequalIndentkeepDecoratorsz*print('testing: one, two, three, & four') zprint('is five.')	z)print('testing: one, two, three, & four')zprint('is five.')nameonelinefunctionvisitorvisit_FunctionDef	inputCodezCdef testFunctionOneLine():
                """Here is the brief."""expectedOutputzC## @brief Here is the brief.
# @namespace dummy.testFunctionOneLinezdef testFunctionOneLine():onelineclassvisit_ClassDefzHclass testClassOneLine(object):
                """Here is the brief."""z@## @brief Here is the brief.
# @namespace dummy.testClassOneLinezclass testClassOneLine():basicfunctionzdef testFunctionBrief():
                """Here is the brief.

                Here is the body. Unlike the brief
                it has multiple lines."""
basicclasszclass testClassBrief(object):
                """Here is the brief.

                Here is the body. Unlike the brief
                it has multiple lines."""basicfunctionnobriefz}def testFunctionNoBrief():
                """Here is the body. It's not a brief as
                it has multiple lines."""basicclassnobriefzclass testClassNoBrief(object):
                """Here is the body. It's not a brief as
                it has multiple lines."""oneargzdef testFunctionArg(arg):
                """Here is the brief.
                Args:
                arg -- a test argument."""multipleargszdef testFunctionArgs(arg1, arg2, arg3):
                """Here is the brief.
                Arguments:
                arg1: a test argument.
                arg2: another test argument.
                arg3: yet another test argument."""multiplelineargsaS  def testFunctionArgsMulti(
                        arg1,
                        arg2,
                        arg3
                    ):
                """Here is the brief.
                Arguments:
                arg1: a test argument.
                arg2: another test argument.
                arg3: yet another test argument."""oneattrzclass testClassAttr(object):
                """Here is the brief.
                Attributes:
                attr -- a test attribute."""multipleattrszclass testClassArgs(object):
                """Here is the brief.
                Attributes:
                attr1: a test attribute.
                attr2: another test attribute.
                attr3: yet another test attribute."""returnszxdef testFunctionReturns():
                """Here is the brief.
                Returns:
                Good stuff."""yieldszvdef testFunctionYields():
                """Here is the brief.
                Yields:
                Good stuff."""	oneraiseszdef testFunctionRaisesOne():
                """Here is the brief.
                Raises:
                MyException: bang bang a boom."""multipleraiseszdef testFunctionRaisesMultiple():
                """Here is the brief.
                Raises:
                MyException1 -- bang bang a boom.
                MyException2 -- crash.
                MyException3 -- splatter."""oneraisesclasszclass testClassRaisesOne(object):
                """Here is the brief.
                Raises:
                MyException: bang bang a boom."""multipleraisesclasszclass testClassRaisesMultiple(object):
                """Here is the brief.
                Raises:
                MyException1 -- bang bang a boom.
                MyException2 -- crash.
                MyException3 -- splatter."""
c                    \         P                  V n        \        \         P                  V P                  4      V n        R# )z6
Sets up a temporary AST for use with our unit tests.
N)r   _TestDoxypypy__Optionsoptionsr   _TestDoxypypy__dummySrcdummyWalkerselfs   &@/usr/lib/python3.14/site-packages/doxypypy/test/test_doxypypy.pysetUpTestDoxypypy.setUp:  s*     $--$\%<%<dllK    c                    RRRRRRRRRRR	R	/pVP                  4        F<  pV P                  V P                  P                  V^ ,          4      V^,          4       K>  	  R
# )z
Test the stripOutAnds method.
zThis and that.z
This that.zThis & that.zThis, that, & more.zThis, that, more.zThis and that & etc.zThis that etc.zHandy.zThis, that, &c.N)itemsassertEqualr6   _stripOutAndsr8   	testPairspairs   &  r9   test_stripOutAndsTestDoxypypy.test_stripOutAndsA  sh    
 lL!#6"$4h0
	 OO%DT--;;DGDd1gN &r<   c           	     0   RRRR\         ,           R,           R3R	R\         ,           R,           R3R
R\         ,           R,           R3/pVP                  4        F;  pV P                  V P                  P                  ! V^ ,          !  V^,          4       K=  	  R# )z"
Test the endCodeIfNeeded method.
Fduz
# @endcodetri kvarkvinN)unuF)rG   T)rH   T)zkvin  	T)r   r>   r?   r6   _endCodeIfNeededrA   s   &  r9   test_endCodeIfNeeded!TestDoxypypy.test_endCodeIfNeededP  s    
 N<'1D8%@!7*!De L!7&!@% H	
	 OO%DT-->>QH!!W& &r<   c           
        . RORRP                  \        4      R.3. RORRP                  \        4      R.3RR.RP                  \        4      R.3. RORRRRP                  \        4      R.3.pV F[  w  r#R	.pV P                  P                  V4      p\	        V4       F  w  rgVP                  WrV34       K  	  V P                  W#4       K]  	  R
# )z0
Tests the checkIfCode method on the code side.
This is prose, not code.>>> print("Now we have code.")z...{0}# @code{0}z(Traceback: frobnotz failure{0}# @code{0}z%This is prose, not code.{0}# @code{0}This is still prose, not code.(Another line of prose to really be sure.z&Ditto again, still prose.{0}# @code{0}FN)rO   ...rP   )rO   zTraceback: frobnotz failurerP   )rO   rQ   rR   zDitto again, still prose.rP   formatr   r6   _checkIfCode	enumeratesendr?   )r8   rB   	testLinesoutputLinesinCodeBlockObjcodeCheckerlineNumlines   &       r9   test_checkIfCodeTestDoxypypy.test_checkIfCode^  s   
 /&--g64

 />EEgN4
 /4 <BB7K4	 /4><CCGL4;,
	Z '0"I#WN**77GK!*9!5  $7!;< "6Y4 '0r<   c                   RR.RP                  \        4      R.3RR.RP                  \        4      R.3RR.RP                  \        4      R.3. RORR	R
P                  \        4      R.3. RORR	RR	R
P                  \        4      R.3.pV F[  w  r#R.pV P                  P                  V4      p\	        V4       F  w  rgVP                  WrV34       K  	  V P                  W#4       K]  	  R# )z1
Tests the checkIfCode method on the prose side.
rS   rO   z...{0}# @endcode{0}zTraceback: frobnotz errorz)Traceback: frobnotz error{0}# @endcode{0}z>>> print("Code.")z">>> print("Code."){0}# @endcode{0}>>> myVar = 23>>> print(myVar)z{0}# @endcode{0}>>> myVar += 5TN)rb   rc    rO   )rb   rc   rd   rc   re   rO   rT   )r8   rB   rY   rZ   r[   proseCheckerr]   r^   s   &       r9   test_checkIfProseTestDoxypypy.test_checkIfProse  s>    . *009.	 0. @FFwO.	 ). 9??H.	 %&&--g6.	 %&$&&--g6.K6
	n '0"I"VN++88HL!*9!5!!4G"<= "6Y4 '0r<   c                    RRRRRRRRRRR	R/pVP                  4        F<  pV P                  V P                  P                  V^ ,          4      V^,          4       K>  	  R# )
z"
Test the checkMemberName method.
publicN
_protected	protected_stillProtected_	__privateprivate__stillPrivate___notPrivate__)r>   r?   r6   _checkMemberNamerA   s   &  r9   test_checkMemberName!TestDoxypypy.test_checkMemberName  sh    
 d+yd
	 OO%DT-->>tAwG!!W& &r<   c                b    V P                  V P                  P                  R.4      RR.4       R# )z"
Test the getFullPathName method.
N)oneclass)r   module)r?   r6   _getFullPathNamer7   s   &r9   test_getFullPathName!TestDoxypypy.test_getFullPathName  s3     	))::<L;MN-/?@	Br<   c                v    V P                  V P                  P                  4       \        P                  4       R# )z
Test the getLines method.
N)r?   r6   getLinesr   _TestDoxypypy__strippedDummySrcr7   s   &r9   test_getLinesTestDoxypypy.test_getLines  s,     	))224%88	:r<   c                    V P                   P                  4        V P                  V P                   P                  4       \        P
                  4       R# )z
Test the parseLines method.
N)r6   
parseLinesr?   r}   r   r~   r7   s   &r9   test_parseLinesTestDoxypypy.test_parseLines  s>    
 	##%))224%88	:r<   c                `   V P                   P                  pV F  pVR,          R,           V P                   n        \        VR,          P                  V P                  4      V P                   4      p\        VR,          4      p\        WCR,          4      ! VP                  ^ ,          4       VP                   Uu. uF"  qfP                  \        V P                  4      NK$  	  upVP                  R&   V P                  VP                  VR,          4       K  	  W P                   n        R# u upi )z8
Compare docstring parsing for a list of code snippets.
r   .pyr   r   :NNNr   N)r4   r   r   split!_TestDoxypypy__linesep_for_sourcer   getattrbodylinesreplacer   r?   )r8   sampleSnippetsoptions_namesnippetTest
testWalkerfuncAstr^   s   &&     r9   snippetComparisonTestDoxypypy.snippetComparison  s     ||,,)K$/$7%$?DLL!";{#;#A#A$B[B[#\#'<<1JK45GJI 67QHakaqaq"raqY]<<9R9R#Saq"rJQZ--{;K/LM * !- #ss   :(D+c                D    V P                  \        P                  4       R# )z0
Tests the proper handling of basic docstrings.
N)r   r   _TestDoxypypy__sampleBasicsr7   s   &r9   test_sampleBasicsTestDoxypypy.test_sampleBasics       	|::;r<   c                D    V P                  \        P                  4       R# )z@
Tests the proper handling of arguments in function docstrings.
N)r   r   _TestDoxypypy__sampleArgsr7   s   &r9   test_sampleArgsTestDoxypypy.test_sampleArgs  s     	|889r<   c                D    V P                  \        P                  4       R# )z>
Tests the proper handling of attributes in class docstrings.
N)r   r   _TestDoxypypy__sampleAttrsr7   s   &r9   test_sampleAttrsTestDoxypypy.test_sampleAttrs  s     	|99:r<   c                D    V P                  \        P                  4       R# )zI
Tests the proper handling of returns and yields in function docstrings.
N)r   r   _TestDoxypypy__sampleReturnsr7   s   &r9   test_sampleReturnsTestDoxypypy.test_sampleReturns   s     	|;;<r<   c                D    V P                  \        P                  4       R# )zG
Tests the proper handling of raises in function and class docstrings.
N)r   r   _TestDoxypypy__sampleRaisesr7   s   &r9   test_sampleRaisesTestDoxypypy.test_sampleRaises&  r   r<   c                    V P                   pVR8X  d   \        V4      pM\        W!R7      pVP                  4       pVP	                  4        \        W@4      pVP                  4        VP                  4       # )zJ
Helper function to read and parse a given file and create an AST walker.
ASCIIencoding)r   r   
codecsOpen	readlinescloser   r   r}   )r4   r   
inFilenameinFiler   r   s   &&    r9   readAndParseFileTestDoxypypy.readAndParseFile,  sg    
 %%
w*%F
>F  "u.
""$$r<   c                   \        \        V4      4      ^ ,          pVP                  \        R4      pV'       g\   R\	        RRRVV^VRVRR7
      3R\	        RRRVV^VRVRR7
      3R\	        RRRVR^VRVRR7
      3R	\	        RRRVR^VRVRR7
      33pMR
\	        RRRVR^VRVRR7
      33pV F  pV P                  V^,          VR7      p\        V4      ^ ,          V^ ,          ,           R,           p	\        V	4      p
V
P                  4       pV
P                  4        \        P                  ! R V 4       4      pV P                  VP                  \        4      VP                  \        4      4       K  	  R# )z~
Compare the results against expectations.

Read and process the input file and compare its output against the gold
standard.
.z.outTFr   z.outncz.outnnNz.outbarez.outeqr   r   c              3   B   "   T F  pVP                  4       x  K  	  R # 5i)N)rstrip).0r^   s   & r9   	<genexpr>:TestDoxypypy.compareAgainstGoldStandard.<locals>.<genexpr>  s       'E3C4 (,{{}}3Cs   )r   r   r   r   r   r   r   r   r   r   joinr?   r   )r8   r   r   r   inFilenameBaser   trialsr4   outputgoldFilenamegoldFilegoldContentLinesgoldContents   &&&&         r9   compareAgainstGoldStandard'TestDoxypypy.compareAgainstGoldStandard?  s    "(:"67:*223<"!&7&4'#( +#(  9""&7&4'#( +#(  9"!&7&*'#( +#(  i#"&7&*'#( +#( K1Ff  )"!&7&*'#' +#(#  F G**71:*IF#J/2WQZ?%GLL)H'113NN ",, 'E3C'E EKV]]73[5G5G5PQ r<   c                ,    RpV P                  V4       R# )z-
Test the basic example included in PEP 257.
zdoxypypy/test/sample_pep.pyNr   r8   
sampleNames   & r9   test_pepProcessingTestDoxypypy.test_pepProcessing  s     3
''
3r<   zdifferent behavior for Python 2)reasonc                ,    RpV P                  V4       R# )zP
Test an example with different combinations of public, protected, and private.
zdoxypypy/test/sample_privacy.pyNr   r   s   & r9   test_privacyProcessing#TestDoxypypy.test_privacyProcessing  s    
 7
''
3r<   c                ,    RpV P                  V4       R# )z5
Test the examples in the Google Python Style Guide.
zdoxypypy/test/sample_google.pyNr   r   s   & r9   test_googleProcessing"TestDoxypypy.test_googleProcessing  s     6
''
3r<   c                ,    RpV P                  V4       R# )z
Test raw docstrings.
z$doxypypy/test/sample_rawdocstring.pyNr   r   s   & r9   test_rawdocstringProcessing(TestDoxypypy.test_rawdocstringProcessing  s     <
''
3r<   c                ,    RpV P                  V4       R# )z#
Test arbitrary sections handling.
z doxypypy/test/sample_sections.pyNr   r   s   & r9   test_sectionsProcessing$TestDoxypypy.test_sectionsProcessing  s     8
''
3r<   c                ,    RpV P                  V4       R# )z3
Test the basic example used in the doxypypy docs.
z"doxypypy/test/sample_docexample.pyNr   r   s   & r9   test_docExampleProcessing&TestDoxypypy.test_docExampleProcessing       :
''
3r<   c                ,    RpV P                  V4       R# )z-
Test an example with ZOPE style interfaces.
z"doxypypy/test/sample_interfaces.pyNr   r   s   & r9   test_interfaceProcessing%TestDoxypypy.test_interfaceProcessing  r   r<   c                ,    RpV P                  V4       R# )z;
Test a basic example inspired by the Commodore one-liner.
zdoxypypy/test/sample_maze.pyNr   r   s   & r9   	test_mazeTestDoxypypy.test_maze  s     4
''
3r<   c                0    RpV P                  VRR7       R# )z'
Test a trivial UTF-8 file with a BOM.
zdoxypypy/test/sample_utf8bom.pyz	UTF-8-SIGr   Nr   r   s   & r9   test_utf8_bomTestDoxypypy.test_utf8_bom  s     7
''
['Ir<   c                0    RpV P                  VRR7       R# )z+
Test a trivial UTF-16-BE file with a BOM.
z"doxypypy/test/sample_utf16bebom.pyUTF-16r   Nr   r   s   & r9   test_utf16be_bomTestDoxypypy.test_utf16be_bom       :
''
X'Fr<   c                0    RpV P                  VRR7       R# )z+
Test a trivial UTF-16-LE file with a BOM.
z"doxypypy/test/sample_utf16lebom.pyr   r   Nr   r   s   & r9   test_utf16le_bomTestDoxypypy.test_utf16le_bom  r   r<   c                0    RpV P                  VRR7       R# )z+
Test a trivial UTF-32-BE file with a BOM.
z"doxypypy/test/sample_utf32bebom.pyUTF-32r   Nr   r   s   & r9   test_utf32be_bomTestDoxypypy.test_utf32be_bom  r   r<   c                0    RpV P                  VRR7       R# )z+
Test a trivial UTF-32-LE file with a BOM.
z"doxypypy/test/sample_utf32lebom.pyr   r   Nr   r   s   & r9   test_utf32le_bomTestDoxypypy.test_utf32le_bom  r   r<   znot supported in Python 2c                ,    RpV P                  V4       R# )z#
Test the examples for rst styles.
"doxypypy/test/sample_rstexample.pyNr   r   s   & r9   test_rstProcessingTestDoxypypy.test_rstProcessing  s    
 :
''
3r<   c                0    RpV P                  VRR7       R# )z7
Test the examples with rst and indentation reduction.
r   T)r   Nr   r   s   & r9   test_indentProcessing"TestDoxypypy.test_indentProcessing  s    
 :
''
'Er<   c                ,    RpV P                  V4       R# )z5
Test the examples with async functions and methods.
zdoxypypy/test/sample_async.pyNr   r   s   & r9   test_asyncProcessing!TestDoxypypy.test_asyncProcessing  s    
 5
''
3r<   )r6   r4   )## @brief Here is the brief.#3#                Here is the body. Unlike the briefzL#                it has multiple lines.
# @namespace dummy.testFunctionBriefzdef testFunctionBrief():)r   r   r   zI#                it has multiple lines.
# @namespace dummy.testClassBriefzclass testClassBrief():)'##Here is the body. It's not a brief aszN#                it has multiple lines.
# @namespace dummy.testFunctionNoBriefzdef testFunctionNoBrief():)r  zK#                it has multiple lines.
# @namespace dummy.testClassNoBriefzclass testClassNoBrief():)r   r   zA# @param		arg	a test argument.
# @namespace dummy.testFunctionArgzdef testFunctionArg(arg):)r   r   # @param		arg1	a test argument.%# @param		arg2	another test argument.zM# @param		arg3	yet another test argument.
# @namespace dummy.testFunctionArgsz'def testFunctionArgs(arg1, arg2, arg3):)
r   r   r  r  zR# @param		arg3	yet another test argument.
# @namespace dummy.testFunctionArgsMultizdef testFunctionArgsMulti(z                        arg1,z                        arg2,z                        arg3z                    ):)r   z"#
# @namespace dummy.testClassAttrzclass testClassAttr():z'
## @property		attr
# a test attribute.)r   z"#
# @namespace dummy.testClassArgszclass testClassArgs():z(
## @property		attr1
# a test attribute.z.
## @property		attr2
# another test attribute.z2
## @property		attr3
# yet another test attribute.)r   	# @returnzC#                Good stuff.
# @namespace dummy.testFunctionReturnszdef testFunctionReturns():)r   r  zB#                Good stuff.
# @namespace dummy.testFunctionYieldszdef testFunctionYields():)r   r   zT# @exception		MyException	bang bang a boom.
# @namespace dummy.testFunctionRaisesOnezdef testFunctionRaisesOne():)r   r   ,# @exception		MyException1	bang bang a boom.!# @exception		MyException2	crash.zR# @exception		MyException3	splatter.
# @namespace dummy.testFunctionRaisesMultiplez!def testFunctionRaisesMultiple():)r   r   zQ# @exception		MyException	bang bang a boom.
# @namespace dummy.testClassRaisesOnezclass testClassRaisesOne():)r   r   r  r  zO# @exception		MyException3	splatter.
# @namespace dummy.testClassRaisesMultiplez class testClassRaisesMultiple():)r   )r   F)       )9__name__
__module____qualname____firstlineno____doc__maxDiffr   r3   r   r5   r   r~   r   r   r   r   r   r   r:   rD   rL   r_   rg   rs   rz   r   r   r   r   r   r   r   r   staticmethodr   r   r   r
   skipifr	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r9   r   r      s`     G!!I 	5w>'J !3'  %* ,V,		
 N' ,S+	
 O* -
  
  L' -
  
  ** -  
 '' -  
yHNV H* .  	
 N* 7  
$ &* 	7  
?9Lx I' 0  	
 O' 9  
 MF I* "  	
 H* "  
O> K* 5  	
 $* 0  
$ $' 5  
 )' 0  
Y>N~LO&65p@5D& B::-<:;=< % %$TRl4 
[[&/PQ4 R4444444JGGGG 
[[&/JK4 L4 
[[&/JKF LF 
[[&/JK4 L4r<   r   __main__)main)r  unittestargparser   osr   r   os.pathr   r   astr   codecsr   r   sysr	   pytestr
   doxypypyr   TestCaser   r	  r   r<   r9   <module>r!     sU       &  %    q48$$ q4h z F r<   