Skip to content

Commit 171fd57

Browse files
committed
fmt
1 parent 694c26f commit 171fd57

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

python/lib/sift_client/_tests/util/test_test_results_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,10 @@ def test_evaluate_measurement_bounds_with_numeric_bounds_object(self):
539539
def test_numeric_bounds_bad_value_type(self):
540540
"""Test that an error is raised if the value is not a float or int when evaluating numeric bounds."""
541541
measurement = TestMeasurementUpdate()
542-
with pytest.raises(TypeError, match="Value must be a float or int to evaluate numeric bounds but gave <class 'str'>"):
542+
with pytest.raises(
543+
TypeError,
544+
match="Value must be a float or int to evaluate numeric bounds but gave <class 'str'>",
545+
):
543546
evaluate_measurement_bounds(measurement, "1", {"min": 0.0, "max": 10.0})
544547

545548
def test_evaluate_measurement_bounds_string_matching(self):

python/lib/sift_client/util/test_results/bounds.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,12 @@ def evaluate_measurement_bounds(
7272
measurement.passed = True
7373
try:
7474
if measurement.numeric_bounds.min is not None:
75-
measurement.passed = (
76-
measurement.passed and measurement.numeric_bounds.min <= value
77-
)
75+
measurement.passed = measurement.passed and measurement.numeric_bounds.min <= value
7876
if measurement.numeric_bounds.max is not None:
79-
measurement.passed = (
80-
measurement.passed and measurement.numeric_bounds.max >= value
81-
)
77+
measurement.passed = measurement.passed and measurement.numeric_bounds.max >= value
8278
except TypeError:
83-
raise TypeError(f"Value must be a float or int to evaluate numeric bounds but gave {type(value)}") from None
79+
raise TypeError(
80+
f"Value must be a float or int to evaluate numeric bounds but gave {type(value)}"
81+
) from None
8482

8583
return bool(measurement.passed)

0 commit comments

Comments
 (0)