| Server IP : 118.27.122.248 / Your IP : 216.73.216.124 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/__pycache__/ |
Upload File : |
3 �w2_ � @ st d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z e j d�ZG dd � d ej�Z ed krpej� dS )zCTest InteractiveConsole and InteractiveInterpreter from code module� N)�dedent)� ExitStack)�mock)�support�codec @ sd e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Z dS )�TestInteractiveConsolec C s t j� | _| j� d S )N)r ZInteractiveConsole�console�mock_sys)�self� r �:/opt/alt/python36/lib64/python3.6/test/test_code_module.py�setUp s zTestInteractiveConsole.setUpc C s� t � }| j|j� |jtjddd��| _|jtjd��| _|jtjd��| _tjdt j t j d�}|j|�| _t jt j kr�| jj | j_| j`| j`dS ) z.Mock system environment for InteractiveConsolez code.inputT)Zcreatezcode.sys.stdoutzcode.sys.stderrzcode.sys)�wraps�specN)r Z addCleanup�close� enter_contextr Zpatch�infunc�stdout�stderrr �sys�sysmod� excepthook�__excepthook__�ps1�ps2)r �stackZprepatchr r r r s zTestInteractiveConsole.mock_sysc C sL t d�| j_| jj� | j| jjd� d| j_| jj� | j| jjd� d S )N�Finishedz>>> z custom1> )�EOFErrorr �side_effectr �interact�assertEqualr r )r r r r �test_ps1"