Skip to content

Commit 64b9f19

Browse files
partheadandhlee
authored andcommitted
chore: fix flaky samples test due to truncated string (#156)
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 🦕
1 parent 75fe595 commit 64b9f19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

monitoring/snippets/v3/alerts-client/snippets.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ def list_alert_policies(project_name):
3030
client = monitoring_v3.AlertPolicyServiceClient()
3131
policies = client.list_alert_policies(name=project_name)
3232
print(
33-
tabulate.tabulate(
34-
[(policy.name, policy.display_name) for policy in policies],
35-
("name", "display_name"),
33+
str(
34+
tabulate.tabulate(
35+
[(policy.name, policy.display_name) for policy in policies],
36+
("name", "display_name"),
37+
)
3638
)
3739
)
3840

0 commit comments

Comments
 (0)