Skip to content

Commit 80375e4

Browse files
committed
fix: make sonarcube happy
1 parent bf0aaae commit 80375e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/functional/event_handler/test_openapi_encoders.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import math
12
from dataclasses import dataclass
23
from typing import List
34

@@ -97,7 +98,7 @@ def test_openapi_encode_scalars():
9798
assert result == 1
9899

99100
result = jsonable_encoder(1.0)
100-
assert result == 1.0
101+
assert math.isclose(result, 1.0)
101102

102103
result = jsonable_encoder(True)
103104
assert result is True
@@ -151,7 +152,7 @@ def test_openapi_encode_decimal():
151152
from decimal import Decimal
152153

153154
result = jsonable_encoder(Decimal("1.0"))
154-
assert result == 1.0
155+
assert math.isclose(result, 1.0)
155156

156157
result = jsonable_encoder(Decimal("1"))
157158
assert result == 1

0 commit comments

Comments
 (0)