Format: application/x-python-code
⬇ Download File (2.5 KB)
   1  o
   2  
   3  ��h:
   4  �@s�ddlZddlZddlZddlZddlZddlZddlZddlZe�d�ddl	m
   5  Z
   6  dd�Zdd�Zej
   7  d	d
   8  d�dd
   9  ��Zddd�Zdd�Zdd�Ze�dS)�NzIPython.testing.tools�)�toolscCs4|D]}t�|j�r|�d�t�|j�rJ�qdS)z�This function is automatically run by pytest passing all collected test
  10      functions.
  11  
  12      We use it to add asyncio marker to all async tests and assert we don't use
  13      test functions that are async generators which wouldn't make sense.
  14      �asyncioN)�inspect�iscoroutinefunction�objZ
  15  add_marker�isasyncgenfunction)�items�item�r�Fc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/conftest.py�pytest_collection_modifyitemss
  16  
  17  �r
  18  cCs:ddlm}|jr
  19  |��St��}d|j_|j|d�}|S)Nr)�TerminalInteractiveShellT)�config)Zterminal.interactiveshellrZ	_instance�instancerZdefault_configZ
  20  simple_prompt)rr�shellrrr�get_ipythonsr�sessionT)�scopeZautouseccsR�t�d�}t|���tjd<|��rtd��|��dVt	�
  21  t|����dS)Nz./tmp-ipython-pytest-profiledirZ
  22  IPYTHONDIRzUIPython dir temporary path already exists ! Did previous test run exit successfully ?)�pathlib�Path�str�absolute�os�environ�exists�
  23  ValueError�mkdir�shutil�rmtree�resolve)�pathrrr�	work_path+s�
  24  r"cCs"t|t�r|�dd�}t|�dS)Nz
  25  text/plain�)�
  26  isinstance�dict�get�print)Zstrng�startZscreen_linesZ	pager_cmdrrr�nopage6s
  27  r)cCs.t|j|ddd���dtjd�tj��dS)zFReplace the default system call with a capturing one for doctest.
  28      Fr)�split�depthr#)�end�fileN)r'�	getoutput�rstrip�sys�stdout�flush)�self�cmdrrr�xsys<s r5cCsHtt_t�t_t�t_t�tt�tj_tjj�	�ddl
  29  m}t|_
  30  dS)Nr��page)r�builtins�_ip�ip�types�
  31  MethodTyper5�systemZbuiltin_trap�activate�corer7r)Z
  32  pager_pager6rrr�injectJs
  33  r@)rrN)r8rrrrr0r;ZpytestZregister_assert_rewrite�testingrr
  34  rZfixturer"r)r5r@rrrr�<module>s$
  35  
  36  
  37  
  38  
  39  
  40  
  41