§
    L˜ºh?  ã                   ó¨   — d Z ddlZddlZddlZddlZ G d„ dej        ¦  «        Z G d„ de¦  «        Z e	ed¦  «        rd„ Z
ej        ZdS d	„ Z
d
„ ZdS )a[  A subclass of unittest.TestCase which checks for reference leaks.

To use:
- Use testing_refleak.BaseTestCase instead of unittest.TestCase
- Configure and compile Python with --with-pydebug

If sys.gettotalrefcount() is not available (because Python was built without
the Py_DEBUG option), then this module is a no-op and tests will run normally.
é    Nc                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )ÚLocalTestResultzHA TestResult which forwards events to a parent object, except for Skips.c                 óR   — t           j                             | ¦  «         || _        d S ©N)ÚunittestÚ
TestResultÚ__init__Úparent_result)Úselfr
   s     úq/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/google/protobuf/internal/testing_refleaks.pyr	   zLocalTestResult.__init__2   s'   € ÝÔ× Ò  Ñ&Ô&Ð&Ø&€DÔÐÐó    c                 ó<   — | j                              ||¦  «         d S r   )r
   ÚaddError©r   ÚtestÚerrors      r   r   zLocalTestResult.addError6   s!   € ØÔ×Ò  eÑ,Ô,Ð,Ð,Ð,r   c                 ó<   — | j                              ||¦  «         d S r   )r
   Ú
addFailurer   s      r   r   zLocalTestResult.addFailure9   s!   € ØÔ×!Ò! $¨Ñ.Ô.Ð.Ð.Ð.r   c                 ó   — d S r   © )r   r   Úreasons      r   ÚaddSkipzLocalTestResult.addSkip<   s   € Ø€Dr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r   r   r   r   /   sV   € € € € € ØPÐPð'ð 'ð 'ð-ð -ð -ð/ð /ð /ð	ð 	ð 	ð 	ð 	r   r   c                   ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚReferenceLeakCheckerMixinz:A mixin class for TestCase, which checks reference counts.é   Nc                 óÀ  •— t          | | j        ¦  «        }t          |dd¦  «        }t          | dd¦  «        }|s|rd S t          j                             ¦   «         | _        t          t          | ¦  «                             |¬¦  «         t          t          | ¦  «                             |¬¦  «         d}t          |¦  «        }d}g }t          |¦  «        | j        k     r•|                      ¦   «         }t          t          | ¦  «                             |¬¦  «         |                      ¦   «         }	|	|k     r|dk     r|dz  }Œ{d}|                     |	|z
  ¦  «         t          |¦  «        | j        k     °•t          || ¦  «         	 |                      |dg| j        z  ¦  «         d S # t           $ r+ |                     | t%          j        ¦   «         ¦  «         Y d S w xY w)NÚ__unittest_expecting_failure__F)Úresultr   é   é   )ÚgetattrÚ_testMethodNameÚcopyregÚdispatch_tableÚcopyÚ_saved_pickle_registryÚsuperr   Úrunr   ÚlenÚNB_RUNSÚ_getRefcountsÚappendÚprintÚassertEqualÚ	Exceptionr   ÚsysÚexc_info)r   r"   Ú
testMethodÚexpecting_failure_methodÚexpecting_failure_classÚoldrefcountÚlocal_resultÚ
num_flakesÚrefcount_deltasÚnewrefcountÚ	__class__s             €r   r,   zReferenceLeakCheckerMixin.runE   s÷  ø€ Ý˜˜tÔ3Ñ4Ô4€JÝ& zÐ3SÐUZÑ[Ô[ÐÝ% dÐ,LÈeÑTÔTÐØð Ð":ð Ø€fõ
 #*Ô"8×"=Ò"=Ñ"?Ô"?€DÔõ 
Õ
# TÑ*Ô*×.Ò.°fÐ.Ñ=Ô=Ð=Ý	Õ
# TÑ*Ô*×.Ò.°fÐ.Ñ=Ô=Ð=à€KÝ" 6Ñ*Ô*€LØ€Jà€OÝ
ˆoÑ
Ô
 ¤Ò
-Ð
-Ø×&Ò&Ñ(Ô(€kÝÕ% tÑ,Ô,×0Ò0¸Ð0ÑEÔEÐEØ×&Ò&Ñ(Ô(€kð 
�{Ò	"Ð	" z°A¢~ ~ð
 	�a‰ˆ
ØØ€jØ×Ò˜[¨;Ñ6Ñ7Ô7Ð7õ ˆoÑ
Ô
 ¤Ò
-Ð
-õ 
ˆ/˜4Ñ Ô Ð ð,Ø
×Ò�¨¨¨d¬lÑ(:Ñ;Ô;Ð;Ð;Ð;øÝð ,ð ,ð ,Ø‡o‚o�d�CœL™NœNÑ+Ô+Ð+Ð+Ð+Ð+ð,øøøs   ÆF( Æ(1GÇGc                 ó  — t           j                             ¦   «          t           j                             | j        ¦  «         t          j        ¦   «          t          j        ¦   «          t          j        ¦   «          t          j        ¦   «         S r   )	r'   r(   ÚclearÚupdater*   ÚgcÚcollectr4   Úgettotalrefcount)r   s    r   r/   z'ReferenceLeakCheckerMixin._getRefcountsp   sc   € ÝÔ× Ò Ñ"Ô"Ð"ÝÔ×!Ò! $Ô"=Ñ>Ô>Ð>õ „J�L„L€LÝ„J�L„L€LÝ„J�L„L€LÝÔÑ!Ô!Ð!r   r   )r   r   r   r   r.   r,   r/   Ú__classcell__)r>   s   @r   r   r   @   sX   ø€ € € € € ØBÐBà€'ð),ð ),ð ),ð ),ð ),ð ),ðV"ð "ð "ð "ð "ð "ð "r   r   rD   c                 óˆ   — t           f| j        z   } t          | ¦  «        | j        |t	          | j        ¦  «        ¦  «        }|S r   )r   Ú	__bases__Útyper   ÚdictÚ__dict__)Ú
test_classÚ	new_basesÚ	new_classs      r   ÚTestCaserN   }   sH   € Ý*Ð,¨zÔ/CÑC€IØ •�ZÑ Ô ØÔ˜Y­¨ZÔ-@Ñ(AÔ(AñCô C€IàÐr   c                 ó   — | S r   r   )rK   s    r   rN   rN   ‡   s   € ØÐr   c                 ó   — ~ d„ }|S )Nc                 ó   — | S r   r   )Úfuncs    r   ÚSamez&SkipReferenceLeakChecker.<locals>.SameŒ   s   € Ø€kr   r   )r   rS   s     r   ÚSkipReferenceLeakCheckerrT   Š   s   € Øðð ð à€Kr   )r   r'   rB   r4   r   r   r   Úobjectr   ÚhasattrrN   ÚskiprT   r   r   r   ú<module>rX      së   ðð>ð ð €€€Ø 	€	€	€	Ø 
€
€
€
Ø €€€ð	ð 	ð 	ð 	ð 	�hÔ)ñ 	ô 	ð 	ð"8"ð 8"ð 8"ð 8"ð 8" ñ 8"ô 8"ð 8"ðv €7ˆ3Ð"Ñ#Ô#ð ðð ð ð
 &œ]ÐÐÐð
ð ð ðð ð ð ð r   