Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kavigupta committed Feb 13, 2024
1 parent a0a0bec commit c9a264f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def all_nodes_gen_for_scope(scope):
for node in all_nodes_gen_for_variables(scope.variables):
yield scope, node


def remove_directives(annotated_code):
return trim(re.sub(r"\{[^\}]+\}", "", annotated_code))

class DisplayAnnotatedTestCase(unittest.TestCase):
def _check_nodes(self, mapping, *scopes):
overall_scope = [item for scope in scopes for item in all_nodes_gen_for_scope(scope)]
Expand All @@ -110,7 +114,7 @@ def replacer(match):
return ""
annotated_code = re.sub(regex, replacer, annotated_code)
if code is None:
code = trim(re.sub(r"\{[^\}]+\}", "", annotated_code))
code = remove_directives(annotated_code)

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

0 comments on commit c9a264f

Please sign in to comment.