Skip to content

Commit d2108d5

Browse files
author
Qian Chen
committed
test1
1 parent acb82a8 commit d2108d5

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

src/sagemaker_mxnet_serving_container/handler_service.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ def __init__(self):
4444

4545
@staticmethod
4646
def _user_module_transformer(model_dir=environment.model_dir):
47-
try:
48-
user_module = importlib.import_module(environment.Environment().module_name)
49-
except ModuleNotFoundError as e:
50-
logging.error("import_module exception: {}".format(e))
51-
raise ValueError('import_module exception: {}'.format(e))
47+
user_module = importlib.import_module(environment.Environment().module_name)
5248

5349
if hasattr(user_module, 'transform_fn'):
5450
return Transformer(default_inference_handler=DefaultMXNetInferenceHandler())

test/unit/test_handler_service.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,3 @@ def test_user_module_unsupported(import_module, env):
103103

104104
import_module.assert_called_once_with(MODULE_NAME)
105105
e.match('Unsupported model type')
106-
107-
108-
@patch('sagemaker_inference.environment.Environment')
109-
def test_user_module_notfound(env):
110-
env.return_value.module_name = MODULE_NAME
111-
112-
with pytest.raises(ValueError) as e:
113-
HandlerService._user_module_transformer()
114-
115-
importlib.import_module.assert_called_once_with(MODULE_NAME)
116-
e.match('import_module exception')

0 commit comments

Comments
 (0)