Skip to content

Commit d4d91eb

Browse files
committed
fix ruff
1 parent 91e3398 commit d4d91eb

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -956,30 +956,21 @@ def test_runtime_get_count(self, mock_gc_get_count):
956956
f"process.runtime.{self.implementation}.gc_count",
957957
expected_gc_count,
958958
)
959-
expected_gc_collections = [
960-
_SystemMetricsResult({"generation": "0"}, 1),
961-
_SystemMetricsResult({"generation": "1"}, 2),
962-
_SystemMetricsResult({"generation": "2"}, 3),
963-
]
964-
self._test_metrics(
965-
"cpython.gc.collections",
966-
expected_gc_collections,
967-
)
968959

969960
@mock.patch("gc.get_count")
970961
@skipIf(
971962
python_implementation().lower() == "pypy", "not supported for pypy"
972963
)
973-
def test_runtime_get_count(self, mock_gc_get_count):
964+
def test_runtime_get_gc_collections(self, mock_gc_get_count):
974965
mock_gc_get_count.configure_mock(**{"return_value": (1, 2, 3)})
975-
976-
expected = [
977-
_SystemMetricsResult({"count": "0"}, 1),
978-
_SystemMetricsResult({"count": "1"}, 2),
979-
_SystemMetricsResult({"count": "2"}, 3),
966+
expected_gc_collections = [
967+
_SystemMetricsResult({"generation": "0"}, 1),
968+
_SystemMetricsResult({"generation": "1"}, 2),
969+
_SystemMetricsResult({"generation": "2"}, 3),
980970
]
981971
self._test_metrics(
982-
f"process.runtime.{self.implementation}.gc_count", expected
972+
"cpython.gc.collections",
973+
expected_gc_collections,
983974
)
984975

985976
@mock.patch("psutil.Process.num_ctx_switches")

0 commit comments

Comments
 (0)