Skip to content

Commit

Permalink
Try to improve test stability
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jan 22, 2022
1 parent c33b87c commit dc9ac0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grafana_wtf/core.py
Expand Up @@ -407,8 +407,8 @@ def explore_datasources(self):
else:
results_unused.append(result)

results_used = sorted(results_used, key=lambda x: x["datasource"]["uid"] or x["datasource"]["name"])
results_unused = sorted(results_unused, key=lambda x: x["datasource"]["uid"] or x["datasource"]["name"])
results_used = sorted(results_used, key=lambda x: x["datasource"]["name"] or x["datasource"]["uid"])
results_unused = sorted(results_unused, key=lambda x: x["datasource"]["name"] or x["datasource"]["uid"])

response = OrderedDict(
used=results_used,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_commands.py
Expand Up @@ -233,7 +233,7 @@ def find_all_missing_datasources(data):
for item in data:
if "datasources_missing" in item:
missing_items += item["datasources_missing"]
return sorted(missing_items, key=lambda x: x["uid"] or x["name"])
return sorted(missing_items, key=lambda x: x["name"] or x["uid"])


def test_info(docker_grafana, capsys, caplog):
Expand Down

0 comments on commit dc9ac0f

Please sign in to comment.