| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j�z � @ s d dl Zd dlZd dlZd dlZd dlZd dlZd dlZd dlZzd dl m
Z
W n ey3 dZ
Y nw dd� ZG dd� dej
�ZG dd� d�ZG d d
� d
e�ZG dd� d�ZG d
d� de�ZG dd� de�Ze�e
du d�G dd� dej
��Zedkr�e�� dS dS )� N��hamtc s t �� �� fdd��}|S )z*Needed to make reftracking test mode work.c s t �� }|j� g| �R i |��S �N��contextvars�Context�run)�args�kwargs�ctx��func� �(/usr/lib/python3.10/test/test_context.py�wrapper s z!isolated_context.<locals>.wrapper)� functools�wraps)r
r r r r �isolated_context s r c @ s� e Zd Zdd� Zedd� �Zdd� Zdd� Zd d
� Zdd� Z d
d� Z
dd� Zdd� Zedd� �Z
dd� Zdd� Zdd� Zedd� �Zedd� �Zedd � �Zed!d"� �Zed#d$� �Zd%d&� Zed'd(� �Zd)S )*�ContextTestc C s� | � td�� t�� W d � n1 sw Y | � td��
t�d� W d � n1 s0w Y t�d�}| �|jd� | �t�� d|_W d � n1 sTw Y | �t |�t d�� d S )Nztakes exactly 1z
must be a str� �aaa�bbb)
�assertRaisesRegex� TypeErrorr �
ContextVar�assertEqual�name�assertRaises�AttributeError�assertNotEqual�hash)�self�cr r r �test_context_var_new_1 s
��
�z"ContextTest.test_context_var_new_1c C s� t �d�}| �dt|�� t jddd�}| �dt|�� g }t jd|d�}|�|� | �dt|�� | �dt|�� |�d�}| �t|�t|�� | �dt|�� |�|� | �dt|�� d S )N�a�{ ��default�123z...r z used )r r �assertIn�repr�append�set�assertNotIn�reset)r! r"