Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 577b176

Browse files
authored
test (#982)
1 parent 0d01853 commit 577b176

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contrib/opencensus-ext-azure/tests/test_azure_heartbeat_metrics.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ def test_heartbeat_metric_init(self):
8989
self.assertFalse(metric.init)
9090
self.assertEqual(len(metric.properties), 0)
9191

92-
# TODO @lzchen #981
93-
@unittest.skip("Failing because github workflow runs on Azure")
94-
def test_heartbeat_metric_get_metric_init(self):
92+
@mock.patch(
93+
'requests.get',
94+
throw(requests.exceptions.ConnectionError)
95+
)
96+
@mock.patch('os.environ.get')
97+
def test_heartbeat_metric_get_metric_init(self, environ_mock):
98+
environ_mock.return_value = None
9599
metric = heartbeat_metrics.HeartbeatMetric()
96100
self.assertFalse(metric.init)
97101
metrics = metric.get_metrics()

0 commit comments

Comments
 (0)