
    f:
                         d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZ ej                  d       ddl	m
Z
 d Zd Z ej                  dd	      d
        ZddZd Zd Z e        y)    NzIPython.testing.tools   )toolsc                     | D ]S  }t        j                  |j                        r|j                  d       t        j                  |j                        sSJ  y)zThis function is automatically run by pytest passing all collected test
    functions.

    We use it to add asyncio marker to all async tests and assert we don't use
    test functions that are async generators which wouldn't make sense.
    asyncioN)inspectiscoroutinefunctionobj
add_markerisasyncgenfunction)itemsitems     K/var/www/cvtools/html/venv/lib/python3.12/site-packages/IPython/conftest.pypytest_collection_modifyitemsr      sI      8&&txx0OOI&--dhh7778    c                      ddl m}  | j                  r| j                         S t	        j
                         }d|j                  _        | j                  |      }|S )Nr   )TerminalInteractiveShellT)config)terminal.interactiveshellr   	_instanceinstancer   default_configsimple_prompt)r   r   shells      r   get_ipythonr      sS    C))'0022!!#F48F##1 %--V-<ELr   sessionT)scopeautousec               #   @  K   t        j                  d      } t        | j                               t        j
                  d<   | j                         rt        d      | j                          d  t        j                  t        | j                                      y w)Nz./tmp-ipython-pytest-profiledir
IPYTHONDIRzUIPython dir temporary path already exists ! Did previous test run exit successfully ?)pathlibPathstrabsoluteosenvironexists
ValueErrormkdirshutilrmtreeresolve)paths    r   	work_pathr-   +   sf     <<9:D"4==?3BJJ|{{}pqqJJL	
MM#dlln%&s   BBc                 ^    t        | t              r| j                  dd      } t        |        y )Nz
text/plain )
isinstancedictgetprint)strngstartscreen_lines	pager_cmds       r   nopager8   6   s#    %		,+	%Lr   c                     t        | j                  |dd      j                         dt        j                         t        j                  j                          y)zFReplace the default system call with a capturing one for doctest.
    Fr   )splitdepthr/   )endfileN)r3   	getoutputrstripsysstdoutflush)selfcmds     r   xsysrE   <   s<    
 
$..E.
3
:
:
<"3::VJJr   c                  B   t         t        _         t               t        _        t               t        _        t	        j
                  t        t              t        j                  _        t        j                  j                  j                          ddl
m}  t        | _        y )Nr   page)r   builtins_ipiptypes
MethodTyperE   systembuiltin_trapactivatecorerH   r8   
pager_pagerG   s    r   injectrS   J   sU    &H=HL-HK))$3HKKKK%%'DOr   )r   r   N)rI   r   r$   r    r)   r@   rL   pytestregister_assert_rewritetestingr   r   r   fixturer-   r8   rE   rS    r   r   <module>rY      st      	   
     6 7 
8
 i.' /'	 r   