Skip to content

Commit df93df1

Browse files
author
Ignacio Quintero
committed
Fix NoBotoSession
1 parent 6163743 commit df93df1

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

tests/integ/test_local_mode.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import numpy
1919
import pytest
2020

21-
from sagemaker.local import LocalSession
21+
from sagemaker.local import LocalSession, LocalSagemakerRuntimeClient, LocalSagemakerClient
2222
from sagemaker.mxnet import MXNet
2323
from sagemaker.tensorflow import TensorFlow
2424
from tests.integ import DATA_DIR
@@ -35,13 +35,22 @@ class LocalNoS3Session(LocalSession):
3535
"""
3636
def __init__(self):
3737
super(LocalSession, self).__init__()
38-
self.config = {
39-
'local':
40-
{
41-
'local_code': True
42-
}
43-
}
38+
39+
def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
40+
self.boto_session = None
41+
if self.config is None:
42+
self.config = {
43+
'local':
44+
{
45+
'local_code': True,
46+
'region_name': DEFAULT_REGION
47+
}
48+
}
49+
4450
self._region_name = DEFAULT_REGION
51+
self.sagemaker_client = LocalSagemakerClient(self)
52+
self.sagemaker_runtime_client = LocalSagemakerRuntimeClient(self.config)
53+
self.local_mode = True
4554

4655

4756
def test_tf_local_mode(tf_full_version, sagemaker_local_session):

0 commit comments

Comments
 (0)