Skip to content

Commit 3525a4b

Browse files
authored
Merge pull request aws#30 from verdimrc/fp-fix-test-local
Made test local processor to not depend on region setting
2 parents 195e3f9 + a7ea9db commit 3525a4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/unit/test_processing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,18 @@ def test_sklearn_with_all_parameters(
165165
sagemaker_session.process.assert_called_with(**expected_args)
166166

167167

168-
169-
def test_local_mode_disables_local_code_by_default(sklearn_latest_version):
170-
processor = SKLearnProcessor(
171-
framework_version=sklearn_latest_version,
168+
@patch("sagemaker.local.LocalSession.__init__", return_value=None)
169+
def test_local_mode_disables_local_code_by_default(localsession_mock):
170+
Processor(
171+
image_uri="",
172172
role=ROLE,
173173
instance_count=1,
174174
instance_type="local",
175175
)
176176

177177
# Most tests use a fixture for sagemaker_session for consistent behaviour, so this unit test
178178
# checks that the default initialization disables unsupported 'local_code' mode:
179-
assert not get_config_value("local.local_code", processor.sagemaker_session.config)
179+
localsession_mock.assert_called_with(disable_local_code=True)
180180

181181

182182
@patch("sagemaker.utils._botocore_resolver")

0 commit comments

Comments
 (0)