Skip to content

Commit

Permalink
fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Vergnaud committed Oct 3, 2024
1 parent 56b2ce0 commit 9ddfcf6
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions tests/unit/source_code/python/test_python_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,35 +235,6 @@ def test_counts_lines(source: str, line_count: int):
assert tree.line_count() == line_count


@pytest.mark.parametrize(
"source, name, is_builtin",
[
("x = open()", "open", True),
("import datetime; x = datetime.datetime.now()", "now", True),
("import stuff; x = stuff()", "stuff", False),
(
"""def stuff():
pass
x = stuff()""",
"stuff",
False,
),
],
)
def test_is_builtin(source, name, is_builtin):
tree = Tree.normalize_and_parse(source)
nodes = list(tree.node.get_children())
for node in nodes:
if isinstance(node, Assign):
call = node.value
assert isinstance(call, Call)
func_name = TreeHelper.get_call_name(call)
assert func_name == name
assert Tree(call).is_builtin() == is_builtin
return
assert False # could not locate call


def test_first_statement_is_none():
node = Const("xyz")
assert not Tree(node).first_statement()
Expand Down

0 comments on commit 9ddfcf6

Please sign in to comment.