
    BTh                     t   U d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZmZm	Z	m
Z
mZ d dlZddlmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZmZmZ ddl m!Z!m"Z" da#ed   e$d<    ed      dee%   defd       Z&d1dZ'd2dZ(ddde%dededee
e%      f
dZ)deddfdZ*dedede
d    ddfd!Z+deddfd"Z,d#ejZ                  ddfd$Z. ej^                  d%&      dd'd(e0ddfd)       Z1d*ed(e0deddfd+Z2ejf                  d3d.       Z4 ejf                  dd%/      d,d-de	d   fd0       Z5y)4    N)	lru_cache)gettext)AnyContextManagerIteratorListOptional   )DiffModeSnapshotAssertion)DISABLE_COLOR_ENV_VAR)FailedToLoadModuleMember)DEFAULT_EXTENSION)PyTestLocation)patch_pycharm_diff)SnapshotSession)received_styleresetsnapshot_style)env_contextimport_module_memberr   _syrupy)maxsizevaluereturnc                 x    | st         S 	 t        |       S # t        $ r}t        j                  |      |d }~ww xY wN)r   r   r   argparseArgumentTypeError)r   es     a/var/www/catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/syrupy/__init__.py__import_extensionr"   %   s>      3#E**# 3((+23s   
 	949c                    | j                  d      }|j                  ddddd       |j                  dddd	d
       |j                  ddddd       |j                  dddd       |j                  ddt        j                  j	                          dd       |j                  ddddd       |j                  dt
        j                  t        t
              t
        dd       |j                  dddd  !       y)"z
    Exposes snapshot plugin configuration to pytest.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_addoption
    syrupyz--snapshot-update
store_trueFupdate_snapshotszUpdate snapshots)actiondefaultdesthelpz--snapshot-warn-unusedwarn_unused_snapshotszDo not fail on unused snapshotsz--snapshot-detailsinclude_snapshot_detailsz7Include details of unused snapshots in the final reportz--snapshot-default-extensionNdefault_extensionz&Specify the default snapshot extension)r(   r)   r*   z--snapshot-no-colors	no_colorsz(Disable test results output highlightingz--snapshot-patch-pycharm-diffr   zPatch PyCharm diffz--snapshot-diff-mode	diff_modez@Controls how diffs are represented on snapshot assertion failure)r(   choicestyper)   r*   z!--snapshot-ignore-file-extensionsignore_file_extensionszLComma separated list of file extensions to ignore when discovering snapshotsc                 $    | j                  d      S )N,)split)vs    r!   <lambda>z"pytest_addoption.<locals>.<lambda>n   s    qwws|     )r)   r*   r1   )getgroup	addoptionsysstdoutisattyr   DETAILEDlist)parsergroups     r!   pytest_addoptionrB   /   s7   
 OOH%E	OO   
OO $.   
OO'F   
OO& 5	   
OOJJ%%''7   
OO'!!   
OO!!XO   
OO+%[#	  r8   configpytest.Configc                 |    | j                   j                  rt        di}t        di |S t	        j
                         S )Ntrue )optionr.   r   r   
contextlibnullcontext)rC   envs     r!   __terminal_colorrL   r   s<    }}!6
 !S!! %%''r8   opleftrightc           
      V   t        |t              st        |t              syt        |       5  t        d      }dt        dt        fd}t        |t              rVt         ||j                         d| d|       }|g|j                  | j                  j                        z   cddd       S t        |t              rVt        | d| d ||j                               }|g|j                  | j                  j                        z   cddd       S 	 ddd       y# 1 sw Y   yxY w)z
    Return explanation for comparisons in failing assert expressions.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_assertrepr_compare
    Nz[+ received]namer   c                      t        d|  d      S )Nz[- ])r   )rQ   s    r!   snapshot_namez0pytest_assertrepr_compare.<locals>.snapshot_name   s    !CvQ-00r8    )r/   )

isinstancer   rL   r   strr   rQ   get_assert_diffrH   r/   )rC   rM   rN   rO   received_namerT   
assert_msgs          r!   pytest_assertrepr_comparer[   }   s/    d-.z 8 	&	! &~6	1 	1 	1 d-.-		":!;1RD-QRJ<$"6"6 --11 #7 #   01-"Q}UZZ7P6QRSJ<%"7"7 --11 #8 #   2  !  s   A8D/ADD(sessionc                     t        | | j                  j                  j                        | j                  _        | j                  j                  a| j                  j                  j                          y)z
    Initialize snapshot session before tests are collected and ran.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_sessionstart
    )pytest_sessionr2   N)r   rC   rH   r2   r   startr\   s    r!   pytest_sessionstartra      sR    
 -&~~44KKGNN
 nn$$GNN  "r8   itemszpytest.Itemc                 :    |j                   j                  |       y)z
    After tests are collected and before any modification is performed.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_collection_modifyitems
    N)r   collect_items)r\   rC   rb   s      r!   pytest_collection_modifyitemsre      s     NN  'r8   c                 b    | j                   j                  j                  | j                         y)z
    After collection has been performed and modified.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_collection_finish
    N)rC   r   select_itemsrb   r`   s    r!   pytest_collection_finishrh      s     
 NN''6r8   reportc                     t         r;| j                  dk7  r+t         j                  | j                  | j                         yyy)z
    After each of the setup, call and teardown runtest phases of an item.
    https://docs.pytest.org/en/8.0.x/reference/reference.html#pytest.hookspec.pytest_runtest_logreport
    teardownN)r   whenran_itemnodeidoutcome)ri   s    r!   pytest_runtest_logreportrp      s1     6;;*,7 -wr8   T)tryfirstzpytest.Session
exitstatusc                 x    | xj                   || j                  j                  j                         z  z  c_         y)z
    Finish session run and set exit status.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_sessionfinish
    N)rr   rC   r   finish)r\   rr   s     r!   pytest_sessionfinishru      s-     *w~~'='='D'D'FFFr8   terminalreporterc                 D   t        |      5  d}| j                  j                  j                  j                  D ]P  }t        |j                               }|r|s| j                  dt        d             d}|s@| j                  |       R 	 ddd       y# 1 sw Y   yxY w)z
    Add syrupy report to pytest.
    https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_terminal_summary
    F-zsnapshot report summaryTN)
rL   rC   r   ri   linesboolstrip	write_sepr   
write_line)rv   rr   rC   is_printing_reportlinehas_report_lines         r!   pytest_terminal_summaryr      s     
&	! 2"$++33::@@ 	2D"4::<0O'9 **38Q0RS%)"! ++D1	22 2 2s   A,B9BBrequestpytest.FixtureRequestc                    t        | j                  j                  j                  t	        | j                  j                  j
                        t        | j                        | j                  j                  j                        S )N)r&   extension_classtest_locationr\   )
r   rC   rH   r&   r"   r-   r   noder\   r   r   s    r!   snapshotr      sY     ..??*7>>+@+@+R+RS$W\\2&&..	 r8   )scopeautousec              #      K   | j                   j                  j                  rt               5  d  d d d        y d  y # 1 sw Y   y xY wwr   )rC   rH   r   r   s    r!   _syrupy_apply_ide_patchesr      s@     ~~//! 		 	 		 	s   +AA A A	A)r@   zpytest.Parserr   N)rC   rD   r   zContextManager[None])r   r   r   r   )6r   rI   r;   	functoolsr   r   typingr   r   r   r   r	   pytest	assertionr   r   	constantsr   
exceptionsr   
extensionsr   locationr   patches.pycharm_diffr   r\   r   terminalr   r   r   utilsr   r   r   __annotations__rW   r"   rB   rL   r[   ra   re   rh   
TestReportrp   hookimplintru   r   fixturer   r   rG   r8   r!   <module>r      s     
     2 , 0 ) $ 4 $ 
 (,#	$ + 13hsm 3 3 3@F(!$,/8;d3i@# # #(((&*=&9(	(7c 7d 78V%6%6 84 8 $G"2 G G G  G22'*2472	2$   i.'> 8D>  /r8   