|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/test/__pycache__/ |
U
>��g* � @ sF d dl Z d dlZd dlmZmZ G dd� dej�ZedkrBe�� dS )� N)� swap_item� swap_attrc @ s` e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� Zdd� Zdd� Z
dS )�RebindBuiltinsTestsz=Test all the ways that we can change/shadow globals/builtins.c G s dS )a� Perform TestCase-specific configuration on a function before testing.
By default, this does nothing. Example usage: spinning a function so
that a JIT will optimize it. Subclasses should override this as needed.
Args:
func: function to configure.
*args: any arguments that should be passed to func, if calling it.
Returns:
Nothing. Work will be performed on func in-place.
N� )�self�func�argsr r �0/opt/cppython/lib/python3.8/test/test_dynamic.py�configure_func
s
z"RebindBuiltinsTests.configure_funcc C sP dd� }| � |� | �|� d� tt� ddd� �� | �|� d� W 5 Q R X d S )Nc S s t dddg�S �N� � � ��lenr r r r �foo s z=RebindBuiltinsTests.test_globals_shadow_builtins.<locals>.foor r c S s dS �N� r ��xr r r �<lambda># � zBRebindBuiltinsTests.test_globals_shadow_builtins.<locals>.<lambda>r �r
�assertEqualr �globals�r r r r r �test_globals_shadow_builtins s
z0RebindBuiltinsTests.test_globals_shadow_builtinsc C sN dd� }| � |� | �|� d� ttddd� �� | �|� d� W 5 Q R X d S )Nc S s t dddg�S r r r r r r r ( s z5RebindBuiltinsTests.test_modify_builtins.<locals>.foor r c S s dS r r r r r r r - r z:RebindBuiltinsTests.test_modify_builtins.<locals>.<lambda>r )r
r r �builtinsr r r r �test_modify_builtins&