Skip to content

Commit 8f8b81e

Browse files
authored
change: add pytest marks for integ tests using local mode (#714)
1 parent 42d5908 commit 8f8b81e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tests/integ/test_horovod.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def test_horovod(sagemaker_session, instance_type, tmpdir):
5252
assert read_json('rank-%s' % rank, tmp)['rank'] == rank
5353

5454

55+
@pytest.mark.local_mode
5556
@pytest.mark.parametrize('instances, processes', [
5657
[1, 2],
5758
(2, 1),

tests/integ/test_local_mode.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def _create_model(output_path):
7777
return _create_model
7878

7979

80+
@pytest.mark.local_mode
8081
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
8182
def test_tf_local_mode(tf_full_version, sagemaker_local_session):
8283
with timeout(minutes=5):
@@ -116,6 +117,7 @@ def test_tf_local_mode(tf_full_version, sagemaker_local_session):
116117
estimator.delete_endpoint()
117118

118119

120+
@pytest.mark.local_mode
119121
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
120122
def test_tf_distributed_local_mode(sagemaker_local_session):
121123
with timeout(minutes=5):
@@ -154,6 +156,7 @@ def test_tf_distributed_local_mode(sagemaker_local_session):
154156
estimator.delete_endpoint()
155157

156158

159+
@pytest.mark.local_mode
157160
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
158161
def test_tf_local_data(sagemaker_local_session):
159162
with timeout(minutes=5):
@@ -191,6 +194,7 @@ def test_tf_local_data(sagemaker_local_session):
191194
estimator.delete_endpoint()
192195

193196

197+
@pytest.mark.local_mode
194198
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
195199
def test_tf_local_data_local_script():
196200
with timeout(minutes=5):
@@ -229,6 +233,7 @@ def test_tf_local_data_local_script():
229233
estimator.delete_endpoint()
230234

231235

236+
@pytest.mark.local_mode
232237
def test_local_mode_serving_from_s3_model(sagemaker_local_session, mxnet_model, mxnet_full_version):
233238
path = 's3://%s' % sagemaker_local_session.default_bucket()
234239
s3_model = mxnet_model(path)
@@ -245,6 +250,7 @@ def test_local_mode_serving_from_s3_model(sagemaker_local_session, mxnet_model,
245250
predictor.delete_endpoint()
246251

247252

253+
@pytest.mark.local_mode
248254
def test_local_mode_serving_from_local_model(tmpdir, sagemaker_local_session, mxnet_model):
249255
predictor = None
250256

@@ -261,6 +267,7 @@ def test_local_mode_serving_from_local_model(tmpdir, sagemaker_local_session, mx
261267
predictor.delete_endpoint()
262268

263269

270+
@pytest.mark.local_mode
264271
def test_mxnet_local_mode(sagemaker_local_session, mxnet_full_version):
265272
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
266273
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
@@ -286,6 +293,7 @@ def test_mxnet_local_mode(sagemaker_local_session, mxnet_full_version):
286293
mx.delete_endpoint()
287294

288295

296+
@pytest.mark.local_mode
289297
def test_mxnet_local_data_local_script(mxnet_full_version):
290298
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
291299
script_path = os.path.join(data_path, 'mnist.py')
@@ -310,6 +318,7 @@ def test_mxnet_local_data_local_script(mxnet_full_version):
310318
mx.delete_endpoint()
311319

312320

321+
@pytest.mark.local_mode
313322
def test_local_transform_mxnet(sagemaker_local_session, tmpdir, mxnet_full_version):
314323
data_path = os.path.join(DATA_DIR, 'mxnet_mnist')
315324
script_path = os.path.join(data_path, 'mnist.py')

tests/integ/test_source_dirs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414

1515
import os
1616

17+
import pytest
18+
1719
import tests.integ.local_mode_utils as local_mode_utils
1820
from tests.integ import DATA_DIR, PYTHON_VERSION
1921

2022
from sagemaker.pytorch.estimator import PyTorch
2123

2224

25+
@pytest.mark.local_mode
2326
def test_source_dirs(tmpdir, sagemaker_local_session):
2427
source_dir = os.path.join(DATA_DIR, 'pytorch_source_dirs')
2528
lib = os.path.join(str(tmpdir), 'alexa.py')

0 commit comments

Comments
 (0)