mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
style(tests): ruff format the Prometheus fail-open registry test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
6e03a36e16
commit
915131f75b
1 changed files with 4 additions and 12 deletions
|
|
@ -158,9 +158,7 @@ class TestPrometheusQueueTimeMetric:
|
|||
if len(call[0]) > 0 and call[0][0] == 0.5: # Our test queue time value
|
||||
queue_time_called = True
|
||||
break
|
||||
assert (
|
||||
not queue_time_called
|
||||
), "Queue time metric should not be recorded when queue_time_seconds is missing"
|
||||
assert not queue_time_called, "Queue time metric should not be recorded when queue_time_seconds is missing"
|
||||
|
||||
def test_queue_time_metric_not_recorded_when_negative(self):
|
||||
"""Test that queue time metric is not recorded when queue_time_seconds is negative"""
|
||||
|
|
@ -224,9 +222,7 @@ class TestPrometheusQueueTimeMetric:
|
|||
if len(call[0]) > 0 and call[0][0] == -0.1:
|
||||
negative_value_called = True
|
||||
break
|
||||
assert (
|
||||
not negative_value_called
|
||||
), "Queue time metric should not be recorded for negative values"
|
||||
assert not negative_value_called, "Queue time metric should not be recorded for negative values"
|
||||
|
||||
|
||||
class TestPrometheusTotalLatencyMetric:
|
||||
|
|
@ -399,9 +395,7 @@ class TestPrometheusGuardrailMetrics:
|
|||
error_type="none",
|
||||
hook_type=hook_type,
|
||||
)
|
||||
mock_latency_metric.labels.return_value.observe.assert_called_once_with(
|
||||
latency_seconds
|
||||
)
|
||||
mock_latency_metric.labels.return_value.observe.assert_called_once_with(latency_seconds)
|
||||
|
||||
# Assert - requests metric should be incremented
|
||||
mock_requests_metric.labels.assert_called_once_with(
|
||||
|
|
@ -450,9 +444,7 @@ class TestPrometheusGuardrailMetrics:
|
|||
error_type=error_type,
|
||||
hook_type=hook_type,
|
||||
)
|
||||
mock_latency_metric.labels.return_value.observe.assert_called_once_with(
|
||||
latency_seconds
|
||||
)
|
||||
mock_latency_metric.labels.return_value.observe.assert_called_once_with(latency_seconds)
|
||||
|
||||
# Assert - requests metric should be incremented
|
||||
mock_requests_metric.labels.assert_called_once_with(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue