Skip to content

Commit c9a264f

Browse files
committed
update
1 parent a0a0bec commit c9a264f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def all_nodes_gen_for_scope(scope):
9393
for node in all_nodes_gen_for_variables(scope.variables):
9494
yield scope, node
9595

96+
97+
def remove_directives(annotated_code):
98+
return trim(re.sub(r"\{[^\}]+\}", "", annotated_code))
99+
96100
class DisplayAnnotatedTestCase(unittest.TestCase):
97101
def _check_nodes(self, mapping, *scopes):
98102
overall_scope = [item for scope in scopes for item in all_nodes_gen_for_scope(scope)]
@@ -110,7 +114,7 @@ def replacer(match):
110114
return ""
111115
annotated_code = re.sub(regex, replacer, annotated_code)
112116
if code is None:
113-
code = trim(re.sub(r"\{[^\}]+\}", "", annotated_code))
117+
code = remove_directives(annotated_code)
114118

115119
scope_info = annotate(ast.parse(code), class_binds_near)
116120
scope_info.static_dependency_graph # just check for errors

0 commit comments

Comments
 (0)