Skip to content

Commit 539426b

Browse files
GaryTu1020pengk19
authored andcommitted
fix git test in test_estimator.py (aws#894)
1 parent 2dffe33 commit 539426b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Here are ways to specify ``git_config``:
108108
109109
# Only providing 'repo' is also allowed. If this is the case, latest commit in
110110
# 'master' branch will be used.
111-
git_config = {'repo': 'https://github.com/username/repo-with-training-scripts.git'
111+
git_config = {'repo': 'https://github.com/username/repo-with-training-scripts.git'}
112112
113113
The following are some examples to define estimators with Git support:
114114

tests/unit/test_estimator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,13 @@ def test_git_support_bad_repo_url_format(sagemaker_session):
897897
assert "returned non-zero exit status" in str(error)
898898

899899

900-
def test_git_support_git_clone_fail(sagemaker_session):
900+
@patch(
901+
"subprocess.check_call",
902+
side_effect=subprocess.CalledProcessError(
903+
returncode=1, cmd="git clone https://github.com/aws/no-such-repo.git"
904+
),
905+
)
906+
def test_git_support_git_clone_fail(check_call, sagemaker_session):
901907
git_config = {"repo": "https://github.com/aws/no-such-repo.git", "branch": BRANCH}
902908
fw = DummyFramework(
903909
entry_point="entry_point",

0 commit comments

Comments
 (0)