mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-28 20:52:57 +08:00
Fix 1455: Protect from raw next() calls (#1456)
This commit is contained in:
@ -57,7 +57,7 @@ class TornadoTest(AsyncHTTPTestCase, TestBase):
|
||||
def assert_metric_expected(
|
||||
self, metric, expected_value, expected_attributes
|
||||
):
|
||||
data_point = next(metric.data.data_points)
|
||||
data_point = next(iter(metric.data.data_points))
|
||||
|
||||
if isinstance(data_point, HistogramDataPoint):
|
||||
self.assertEqual(
|
||||
@ -78,7 +78,7 @@ class TornadoTest(AsyncHTTPTestCase, TestBase):
|
||||
def assert_duration_metric_expected(
|
||||
self, metric, duration_estimated, expected_attributes
|
||||
):
|
||||
data_point = next(metric.data.data_points)
|
||||
data_point = next(iter(metric.data.data_points))
|
||||
|
||||
self.assertAlmostEqual(
|
||||
data_point.sum,
|
||||
|
Reference in New Issue
Block a user