Skip to content

Commit

Permalink
Change label list output to [] instead of none in case of no values
Browse files Browse the repository at this point in the history
  • Loading branch information
philnewm committed Sep 11, 2024
1 parent ae64c19 commit ad1599f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions github_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def get_labels(pr_data: dict) -> list:

for item in pr_data:
if not item.get("labels"):
return
return []
for label in item["labels"]:
if not label.get("name"):
return
return []

labels.add(label["name"])

Expand Down
2 changes: 1 addition & 1 deletion tests/test_github_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_get_labels(pr_api_output):
def test_get_labels_missing_input(pr_api_output_missing_label):
labels = github_query.get_labels(pr_data=pr_api_output_missing_label)

assert labels == None
assert labels == []


# Version Increment test-cases
Expand Down

0 comments on commit ad1599f

Please sign in to comment.