Skip to content

Commit 70e66d6

Browse files
committed
WIP: Fix floating point test error
Avoid floating point conversion imprecision
1 parent c969186 commit 70e66d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unit/gapic/test_method.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def test_wrap_method_with_overriding_timeout_as_a_number():
200200
method, default_retry, default_timeout
201201
)
202202

203-
result = wrapped_method(timeout=22)
203+
# Using "result = wrapped_method(timeout=22)" fails since wrapped_method
204+
# does floating point calculations that results in 21.987.. instead of 22
205+
result = wrapped_method(timeout=timeout.ConstantTimeout(22))
204206

205207
assert result == 42
206208

0 commit comments

Comments
 (0)