Skip to content

Commit cb76ce7

Browse files
committed
make py27 unit test build pass
1 parent 87c21bd commit cb76ce7

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

buildspec-unittests.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,12 @@ phases:
1818
- start_time=`date +%s`
1919
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
2020
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21-
tox -e py27,py36,py37 --parallel all -- tests/unit
22-
- ./ci-scripts/displaytime.sh 'py27,py36,py37 unit' $start_time
21+
tox -e py36,py37 --parallel all -- tests/unit
22+
- ./ci-scripts/displaytime.sh 'py36,py37 unit' $start_time
23+
24+
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
25+
- start_time=`date +%s`
26+
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
27+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
28+
IGNORE_COVERAGE=- tox -e py27 --parallel all -- tests/unit
29+
- ./ci-scripts/displaytime.sh 'py27 unit' $start_time

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

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

15+
import sys
16+
1517
import pasta
18+
import pytest
1619

1720
from sagemaker.cli.compatibility.v2.modifiers import tf_legacy_mode
1821

1922

23+
@pytest.fixture(autouse=True)
24+
def skip_if_py2():
25+
# Remove once https://github.com/aws/sagemaker-python-sdk/issues/1461 is addressed.
26+
if sys.version_info.major < 3:
27+
pytest.skip("v2 migration script doesn't support Python 2.")
28+
29+
2030
def test_node_should_be_modified_tf_constructor_legacy_mode():
2131
tf_legacy_mode_constructors = (
2232
"TensorFlow(script_mode=False)",

0 commit comments

Comments
 (0)