Skip to content

Commit bf446b1

Browse files
yangawslaurenyu
authored andcommitted
fix: skip p2 test in regions without p2s, freeze urllib3, and specify allow_pickle=True for numpy (#760)
There were a few test fixes here: * skip a GPU TF script mode test in regions without p2 instances * Freeze urllib3 version to avoid conflicts * Specify allow_pickle=True in npy serializer object test
1 parent 3c77951 commit bf446b1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def read_version():
2929

3030
# Declare minimal set for installation
3131
required_packages = ['boto3>=1.9.64', 'numpy>=1.9.0', 'protobuf>=3.1', 'scipy>=0.19.0',
32-
'urllib3>=1.21', 'protobuf3-to-dict>=0.1.5', 'docker-compose>=1.23.0',
32+
'urllib3>=1.21, <1.25', 'protobuf3-to-dict>=0.1.5', 'docker-compose>=1.23.0',
3333
'requests>=2.20.0, <2.21']
3434

3535
# enum is introduced in Python 3.4. Installing enum back port

tests/integ/test_tf_script_mode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def instance_type(request):
4040
return request.param
4141

4242

43+
@pytest.mark.skipif(integ.test_region() in integ.HOSTING_NO_P2_REGIONS,
44+
reason='no ml.p2 instances in these regions')
4345
@pytest.mark.skipif(integ.PYTHON_VERSION != 'py3', reason="Script Mode tests are only configured to run with Python 3")
4446
def test_mnist(sagemaker_session, instance_type):
4547
estimator = TensorFlow(entry_point=SCRIPT,

tests/unit/test_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_npy_serializer_object():
249249

250250
result = npy_serializer(object)
251251

252-
assert np.array_equal(np.array(object), np.load(io.BytesIO(result)))
252+
assert np.array_equal(np.array(object), np.load(io.BytesIO(result), allow_pickle=True))
253253

254254

255255
def test_npy_serializer_list_of_empty():

0 commit comments

Comments
 (0)