File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2914,24 +2914,6 @@ def test_is_specialization_enabled_with_allow(self):
29142914 finally :
29152915 _testinternalcapi .set_eval_frame_default ()
29162916
2917- def test_record_replaced_function_name (self ):
2918- def target (arg ):
2919- pass
2920-
2921- records = []
2922- names = [f'dynamic_name_{ i } ' for i in range (100 )]
2923- try :
2924- _testinternalcapi .set_eval_frame_interp (records )
2925- for name in names :
2926- target .__name__ = name
2927- # Call through C to avoid inlining bypassing the hook.
2928- list (map (target , [None ]))
2929- finally :
2930- _testinternalcapi .set_eval_frame_default ()
2931- self .assertEqual (
2932- [name for name in records if name .startswith ('dynamic_name_' )],
2933- names )
2934-
29352917 def test_allow_specialization_call (self ):
29362918 def func ():
29372919 pass
Original file line number Diff line number Diff line change @@ -168,39 +168,6 @@ def reader():
168168 threading_helper .run_concurrently (
169169 [writer , reader ] * (NUM_THREADS // 2 ))
170170
171- def test_eval_frame_record_while_replacing_name (self ):
172- from test .support import import_helper
173- _testinternalcapi = import_helper .import_module ('_testinternalcapi' )
174-
175- def target ():
176- pass
177-
178- records = []
179-
180- def writer ():
181- for i in range (ITERS ):
182- target .__name__ = f'target_{ i } '
183-
184- def caller ():
185- for _ in range (ITERS ):
186- target ()
187-
188- def contend ():
189- for _ in range (ITERS ):
190- # Contend with the recording hook for the list's lock.
191- records .extend (['padding' ] * 1000 )
192- records .clear ()
193-
194- try :
195- _testinternalcapi .set_eval_frame_record (records )
196- threading_helper .run_concurrently (
197- [writer , caller , contend , caller ])
198- target ()
199- finally :
200- _testinternalcapi .set_eval_frame_default ()
201- self .assertTrue (any (name .startswith ('target' ) for name in records ))
202- self .assertTrue (all (isinstance (name , str ) for name in records ))
203-
204171 def test_argument_errors_while_replacing_qualname (self ):
205172 def target (x , * , y ):
206173 pass
Original file line number Diff line number Diff line change @@ -81,27 +81,6 @@ def __eq__(self, other):
8181 gc .collect ()
8282 self .assertIsNone (ref ())
8383
84- def test_annotations_setter_reentrant_finalizer (self ):
85- def target ():
86- pass
87-
88- observations = []
89- replacement = {'replacement' : int }
90- finalizer_value = {'finalizer' : str }
91-
92- class Annotations (dict ):
93- def __del__ (self ):
94- observations .append ((target .__annotate__ ,
95- target .__annotations__ is replacement ))
96- target .__annotations__ = finalizer_value
97-
98- target .__annotate__ = lambda format : Annotations ()
99- self .assertIsInstance (target .__annotations__ , Annotations )
100- target .__annotations__ = replacement
101- support .gc_collect ()
102- self .assertEqual (observations , [(None , True )])
103- self .assertIs (target .__annotations__ , finalizer_value )
104-
10584 def test_dir_includes_correct_attrs (self ):
10685 self .b .known_attr = 7
10786 self .assertIn ('known_attr' , dir (self .b ),
Original file line number Diff line number Diff line change @@ -91,36 +91,6 @@ def test_lltrace_different_module(self):
9191 self .assertEqual (instr_map [offset ].opname , opname )
9292 self .assertEqual (instr_map [offset ].arg , oparg )
9393
94- def test_lltrace_replacing_function_attributes (self ):
95- stdout = self .run_code ("""
96- import gc
97-
98- def target():
99- pass
100-
101- class Name(str):
102- def __repr__(self):
103- target.__qualname__ = 'replacement'
104- gc.collect()
105- return "'original_name'"
106-
107- class Module:
108- def __repr__(self):
109- target.__module__ = None
110- gc.collect()
111- return "'original_module'"
112-
113- target.__qualname__ = Name('original_name')
114- target.__module__ = Module()
115- __lltrace__ = 1
116- target()
117- del __lltrace__
118- assert target.__qualname__ == 'replacement'
119- assert target.__module__ is None
120- """ )
121- self .assertIn ("'original_name'" , stdout )
122- self .assertIn ("'original_module'" , stdout )
123-
12494 def test_lltrace_does_not_crash_on_subscript_operator (self ):
12595 # If this test fails, it will reproduce a crash reported as
12696 # bpo-34113. The crash happened at the command line console of
You can’t perform that action at this time.
0 commit comments