Skip to content

infra: remove assumption of Python 2 unit test runs #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ def chainer_version(request):
return request.param


@pytest.fixture(scope="module", params=["py2", "py3"])
def chainer_py_version(request):
return request.param


# TODO: current version fixtures are legacy fixtures that aren't useful
# and no longer verify whether images are valid
@pytest.fixture(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# language governing permissions and limitations under the License.
from __future__ import absolute_import

import sys

import pasta
import pytest

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


@pytest.fixture(autouse=True)
def skip_if_py2():
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
if sys.version_info.major < 3:
pytest.skip("v2 migration script doesn't support Python 2.")


@pytest.fixture
def constructors_empty():
return constructors()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
# language governing permissions and limitations under the License.
from __future__ import absolute_import

import sys

import pasta
import pytest
from mock import MagicMock, patch

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


@pytest.fixture(autouse=True)
def skip_if_py2():
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
if sys.version_info.major < 3:
pytest.skip("v2 migration script doesn't support Python 2.")


def test_node_should_be_modified_tf_constructor_legacy_mode():
tf_legacy_mode_constructors = (
"TensorFlow(script_mode=False)",
Expand Down
Loading