Skip to content

Commit f52b1b3

Browse files
Roshrinimvsusp
authored andcommitted
Adding function to skip test for py2 verison (#128)
1 parent 3ffcebc commit f52b1b3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,4 @@
7979
* Add support for fastai (https://github.com/fastai/fastai) library.
8080
* Remove "requsests" from tests dependencies to avoid regular conflicts with "requests" package from "sagemaker" dependencies.
8181
* Add support for PyTorch-1.0.
82+

test/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ def skip_by_device_type(request, use_gpu, instance_type):
190190
pytest.skip('Skipping because running on \'{}\' instance'.format(instance_type))
191191

192192

193+
@pytest.fixture(autouse=True)
194+
def skip_by_py_version(request, py_version):
195+
if request.node.get_closest_marker('skip_py2') and py_version != 'py3':
196+
pytest.skip('Skipping the test because Python 2 is not supported.')
197+
198+
193199
@pytest.fixture(autouse=True)
194200
def skip_gpu_instance_restricted_regions(region, instance_type):
195201
if((region in NO_P2_REGIONS and instance_type.startswith('ml.p2')) or

0 commit comments

Comments
 (0)