Skip to content

Commit faa5acc

Browse files
coderabbitai[bot]CodeRabbit
andauthored
fix: apply CodeRabbit auto-fixes
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
1 parent 7af62eb commit faa5acc

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tests/common/test_decimal_conversion_comparison.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def test_edge_cases_conversion_comparison(self):
133133
1e28, # Very large
134134
0.0, # Zero
135135
-123.456, # Negative
136-
float("inf"),
137136
]
138137

139138
for py_decimal in test_values:
@@ -155,7 +154,18 @@ def test_edge_cases_conversion_comparison(self):
155154
assert double_result is not None
156155

157156
except Exception as e:
158-
print(f"Error testing {py_decimal}: {e}")
157+
assert False, str(e)
158+
159+
def test_edge_case_infinity_raises(self):
160+
"""Test that infinity raises an exception."""
161+
try:
162+
cs_decimal = CsDecimal(float("inf"))
163+
to_pydecimal(cs_decimal)
164+
to_pydecimal_via_double(cs_decimal)
165+
assert False, "Expected exception for infinity was not raised"
166+
except Exception:
167+
# Exception is expected for infinity
168+
pass
159169

160170
def test_none_input_handling(self):
161171
"""Test that both methods handle None input correctly."""

0 commit comments

Comments
 (0)