Skip to content

Commit 30c5fd0

Browse files
GaryTu1020knakad
authored andcommitted
fix git test in test_estimator.py (aws#894)
1 parent 14f5bae commit 30c5fd0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/overview.rst

+1-1
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

+7-1
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)