Skip to content

Commit 4d1052a

Browse files
author
Jonathan Esterhazy
committed
fix flaky assert
1 parent 6f1df0d commit 4d1052a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/unit/test_tfs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,15 @@ def test_predictor_classify_bad_content_type():
190190
predictor.classify(CLASSIFY_INPUT)
191191

192192

193-
def assert_invoked(sagemaker_session, **args):
194-
sagemaker_session.sagemaker_runtime_client.invoke_endpoint.assert_called_once_with(**args)
193+
def assert_invoked(sagemaker_session, **kwargs):
194+
call = sagemaker_session.sagemaker_runtime_client.invoke_endpoint.call_args
195+
cargs, ckwargs = call
196+
assert not cargs
197+
assert len(kwargs) == len(ckwargs)
198+
for k in ckwargs:
199+
assert kwargs[k] == ckwargs[k]
200+
201+
# sagemaker_session.sagemaker_runtime_client.invoke_endpoint.assert_called_once_with(**kwargs)
195202

196203

197204
def mock_response(expected_response, sagemaker_session, content_type=JSON_CONTENT_TYPE):

0 commit comments

Comments
 (0)