Skip to content

Commit

Permalink
chore: fix flaky samples test due to truncated string (#156)
Browse files Browse the repository at this point in the history
This PR fixes the flaky test reported in #149 where string `'snippets-test-enclcibdnr'`, as an example, is not found in string `'snippets-test-enclci...jects/'` because the string is truncated. We can avoid the issue by casting to `str()` before calling `print()`.

Fixes #149 🦕
  • Loading branch information
parthea authored Jun 18, 2021
1 parent 1458864 commit 6e3aaad
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ def list_alert_policies(project_name):
client = monitoring_v3.AlertPolicyServiceClient()
policies = client.list_alert_policies(name=project_name)
print(
tabulate.tabulate(
[(policy.name, policy.display_name) for policy in policies],
("name", "display_name"),
str(
tabulate.tabulate(
[(policy.name, policy.display_name) for policy in policies],
("name", "display_name"),
)
)
)

Expand Down

0 comments on commit 6e3aaad

Please sign in to comment.