File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_code_module.cpython-312.opt-2.pyc
�
h�e# � �� � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ ej d� Z
G d� dej � Ze
d k( r ej � yy)
� N)�dedent)� ExitStack)�mock)�
import_helper�codec �N � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
y)
�TestInteractiveConsolec �V � t j � | _ | j � y )N)r �InteractiveConsole�console�mock_sys��selfs �</opt/alt/python312/lib64/python3.12/test/test_code_module.py�setUpzTestInteractiveConsole.setUp s � ��.�.�0����
�
�� c � � t � }| j |j � |j t j
dd�� � | _ |j t j
d� � | _ |j t j
d� � | _ t j
dt j t j �� }|j |� | _ t j t j u r%| j j | j _ | j `| j `y )Nz
code.inputT)�createzcode.sys.stdoutzcode.sys.stderrzcode.sys)�wraps�spec)r �
addCleanup�close�
enter_contextr �patch�infunc�stdout�stderrr �sys�sysmod�
excepthook�__excepthook__�ps1�ps2)r �stack�prepatchs r r
zTestInteractiveConsole.mock_sys s� � �8����������$��)�)�$�*�*�\�15�+7� 8����)�)�$�*�*�5F�*G�H����)�)�$�*�*�5F�*G�H����:�:�j����t�x�x�H���)�)�(�3����>�>�S�/�/�/�%)�[�[�%?�%?�D�K�K�"��K�K�O��K�K�Or c �Z � t d� | j _ | j j � | j | j j d� d| j _ | j j � | j | j j d� y )N�Finishedz>>> z custom1> )�EOFErrorr �side_effectr �interact�assertEqualr r"