@@ -1124,43 +1124,6 @@ def test_bug_46724(self):
11241124 # Test that negative operargs are handled properly
11251125 self .do_disassembly_test (bug46724 , dis_bug46724 )
11261126
1127- def test_annotate_source_locations (self ):
1128- # See gh-135700
1129- issue_135700 = "1\n x: int"
1130- issue_135700_class = "class A:\n 1\n x: int"
1131-
1132- test_cases = [
1133- ("module" , compile (issue_135700 , "<string>" , "exec" ).co_consts [1 ]),
1134- (
1135- "class" ,
1136- compile (ast .parse (issue_135700_class ), "?" , "exec" )
1137- .co_consts [0 ]
1138- .co_consts [1 ],
1139- ),
1140- ]
1141-
1142- for case_name , annotate_code in test_cases :
1143- with self .subTest (case = case_name ):
1144- line_starts_iterator = dis .findlinestarts (annotate_code )
1145- valid_line_starts = [
1146- item [0 ]
1147- for item in line_starts_iterator
1148- if item [1 ] is not None
1149- ] # The first item is not RESUME in class case
1150- setup_scope_begin = valid_line_starts [0 ]
1151- setup_scope_end = valid_line_starts [1 ]
1152- setup_annotations_scope_positions = {
1153- instr .positions
1154- for instr in dis .get_instructions (annotate_code )
1155- if setup_scope_begin <= instr .offset < setup_scope_end
1156- and instr .positions
1157- }
1158- self .assertEqual (
1159- len (setup_annotations_scope_positions ),
1160- 1 ,
1161- f"{ case_name } : Expected uniform positions, found { len (setup_annotations_scope_positions )} : { setup_annotations_scope_positions } " ,
1162- )
1163-
11641127 def test_kw_names (self ):
11651128 # Test that value is displayed for keyword argument names:
11661129 self .do_disassembly_test (wrap_func_w_kwargs , dis_kw_names )
0 commit comments