Skip to content

Commit

Permalink
Fix the parser returning a dictionary instead of a list in the empty …
Browse files Browse the repository at this point in the history
…parse scenario
  • Loading branch information
AWhetter committed Aug 29, 2024
1 parent 2fa7515 commit eaac3e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autoapi/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def parse_typealias(self, node):
return [data]

def parse(self, node):
data = {}
data = []

node_type = node.__class__.__name__.lower()
parse_func = getattr(self, "parse_" + node_type, None)
Expand Down
1 change: 1 addition & 0 deletions docs/changes/+f5e49f9f.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the parser returning a dictionary instead of a list in the empty parse scenario
2 changes: 1 addition & 1 deletion tests/python/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_parses_all_multiline(self):

def test_parses_name(self):
source = "foo.bar"
assert self.parse(source) == {}
assert self.parse(source) == []

def test_parses_list(self):
name = "__all__"
Expand Down

0 comments on commit eaac3e0

Please sign in to comment.