Skip to content

Commit 7e04f33

Browse files
committed
infra: remove assumption of Python 2 unit test runs
1 parent 730b1aa commit 7e04f33

File tree

5 files changed

+83
-149
lines changed

5 files changed

+83
-149
lines changed

tests/conftest.py

+5
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ def chainer_version(request):
133133
return request.param
134134

135135

136+
@pytest.fixture(scope="module", params=["py2", "py3"])
137+
def chainer_py_version(request):
138+
return request.param
139+
140+
136141
# TODO: current version fixtures are legacy fixtures that aren't useful
137142
# and no longer verify whether images are valid
138143
@pytest.fixture(

tests/unit/sagemaker/cli/compatibility/v2/modifiers/test_framework_version.py

-9
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# language governing permissions and limitations under the License.
1313
from __future__ import absolute_import
1414

15-
import sys
16-
1715
import pasta
1816
import pytest
1917

@@ -106,13 +104,6 @@ def constructors(versions=False, image=False):
106104
return [ctr for template in TEMPLATES for ctr in template.constructors(versions, image)]
107105

108106

109-
@pytest.fixture(autouse=True)
110-
def skip_if_py2():
111-
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
112-
if sys.version_info.major < 3:
113-
pytest.skip("v2 migration script doesn't support Python 2.")
114-
115-
116107
@pytest.fixture
117108
def constructors_empty():
118109
return constructors()

tests/unit/sagemaker/cli/compatibility/v2/modifiers/test_tf_legacy_mode.py

-10
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
from __future__ import absolute_import
1414

15-
import sys
16-
1715
import pasta
18-
import pytest
1916
from mock import MagicMock, patch
2017

2118
from sagemaker.cli.compatibility.v2.modifiers import tf_legacy_mode
@@ -25,13 +22,6 @@
2522
REGION_NAME = "us-west-2"
2623

2724

28-
@pytest.fixture(autouse=True)
29-
def skip_if_py2():
30-
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
31-
if sys.version_info.major < 3:
32-
pytest.skip("v2 migration script doesn't support Python 2.")
33-
34-
3525
def test_node_should_be_modified_tf_constructor_legacy_mode():
3626
tf_legacy_mode_constructors = (
3727
"TensorFlow(script_mode=False)",

0 commit comments

Comments
 (0)