o
    ú›h:
  ã                   @   s    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 d¡ ddl	m
Z
 dd„ Zdd„ Zejd	d
d�dd„ ƒZddd„Zdd„ Zdd„ Zeƒ  dS )é    NzIPython.testing.toolsé   )Útoolsc                 C   s4   | D ]}t  |j¡r| d¡ t  |j¡rJ ‚qdS )zóThis 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ÚobjZ
add_markerÚisasyncgenfunction)ÚitemsÚitem© r   úFc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/conftest.pyÚpytest_collection_modifyitems   s
   
ýr   c                  C   s:   ddl m}  | jr|  ¡ S t ¡ }d|j_| j|d�}|S )Nr   )ÚTerminalInteractiveShellT)Úconfig)Zterminal.interactiveshellr   Z	_instanceÚinstancer   Zdefault_configZsimple_prompt)r   r   Úshellr   r   r   Úget_ipython   s   r   ÚsessionT)ÚscopeZautousec                  c   sR   � t  d¡} t|  ¡ ƒtjd< |  ¡ rtdƒ‚|  ¡  d V  t	 
t|  ¡ ƒ¡ d S )Nz./tmp-ipython-pytest-profiledirZ
IPYTHONDIRzUIPython dir temporary path already exists ! Did previous test run exit successfully ?)ÚpathlibÚPathÚstrÚabsoluteÚosÚenvironÚexistsÚ
ValueErrorÚmkdirÚshutilÚrmtreeÚresolve)Úpathr   r   r   Ú	work_path+   s   €
r"   c                 C   s"   t | tƒr|  dd¡} t| ƒ d S )Nz
text/plainÚ )Ú
isinstanceÚdictÚgetÚprint)ZstrngÚstartZscreen_linesZ	pager_cmdr   r   r   Únopage6   s   
r)   c                 C   s.   t | j|ddd� ¡ dtjd� tj ¡  dS )zFReplace the default system call with a capturing one for doctest.
    Fr   )ÚsplitÚdepthr#   )ÚendÚfileN)r'   Ú	getoutputÚrstripÚsysÚstdoutÚflush)ÚselfÚcmdr   r   r   Úxsys<   s    r5   c                  C   sH   t t_ t ƒ t_t ƒ t_t tt¡tj_tjj 	¡  ddl
m}  t| _d S )Nr   ©Úpage)r   ÚbuiltinsÚ_ipÚipÚtypesÚ
MethodTyper5   ÚsystemZbuiltin_trapÚactivateÚcorer7   r)   Z
pager_pager6   r   r   r   ÚinjectJ   s   
r@   )r   r   N)r8   r   r   r   r   r0   r;   ZpytestZregister_assert_rewriteÚtestingr   r   r   Zfixturer"   r)   r5   r@   r   r   r   r   Ú<module>   s$    




