@@ -95,7 +95,7 @@ def test_git_clone_repo_clone_fail(mkdtemp, check_call):
9595 dependencies = ["foo" , "bar" ]
9696 with pytest .raises (subprocess .CalledProcessError ) as error :
9797 git_utils .git_clone_repo (git_config , entry_point , source_dir , dependencies )
98- assert "returned non-zero exit status" in str (error )
98+ assert "returned non-zero exit status" in str (error . value )
9999
100100
101101@patch (
@@ -110,7 +110,7 @@ def test_git_clone_repo_branch_not_exist(mkdtemp, check_call):
110110 dependencies = ["foo" , "bar" ]
111111 with pytest .raises (subprocess .CalledProcessError ) as error :
112112 git_utils .git_clone_repo (git_config , entry_point , source_dir , dependencies )
113- assert "returned non-zero exit status" in str (error )
113+ assert "returned non-zero exit status" in str (error . value )
114114
115115
116116@patch (
@@ -129,7 +129,7 @@ def test_git_clone_repo_commit_not_exist(mkdtemp, check_call):
129129 dependencies = ["foo" , "bar" ]
130130 with pytest .raises (subprocess .CalledProcessError ) as error :
131131 git_utils .git_clone_repo (git_config , entry_point , source_dir , dependencies )
132- assert "returned non-zero exit status" in str (error )
132+ assert "returned non-zero exit status" in str (error . value )
133133
134134
135135@patch ("subprocess.check_call" )
@@ -358,7 +358,7 @@ def test_git_clone_repo_with_username_and_password_wrong_creds(mkdtemp, check_ca
358358 env ["GIT_TERMINAL_PROMPT" ] = "0"
359359 with pytest .raises (subprocess .CalledProcessError ) as error :
360360 git_utils .git_clone_repo (git_config = git_config , entry_point = entry_point )
361- assert "returned non-zero exit status" in str (error )
361+ assert "returned non-zero exit status" in str (error . value )
362362
363363
364364@patch (
@@ -381,7 +381,7 @@ def test_git_clone_repo_with_token_wrong_creds(mkdtemp, check_call):
381381 env ["GIT_TERMINAL_PROMPT" ] = "0"
382382 with pytest .raises (subprocess .CalledProcessError ) as error :
383383 git_utils .git_clone_repo (git_config = git_config , entry_point = entry_point )
384- assert "returned non-zero exit status" in str (error )
384+ assert "returned non-zero exit status" in str (error . value )
385385
386386
387387@patch (
@@ -404,7 +404,7 @@ def test_git_clone_repo_with_and_token_2fa_wrong_creds(mkdtemp, check_call):
404404 env ["GIT_TERMINAL_PROMPT" ] = "0"
405405 with pytest .raises (subprocess .CalledProcessError ) as error :
406406 git_utils .git_clone_repo (git_config = git_config , entry_point = entry_point )
407- assert "returned non-zero exit status" in str (error )
407+ assert "returned non-zero exit status" in str (error . value )
408408
409409
410410@patch ("subprocess.check_call" )
@@ -448,7 +448,7 @@ def test_git_clone_repo_codecommit_ssh_passphrase_required(mkdtemp, check_call):
448448 entry_point = "entry_point"
449449 with pytest .raises (subprocess .CalledProcessError ) as error :
450450 git_utils .git_clone_repo (git_config , entry_point )
451- assert "returned non-zero exit status" in str (error )
451+ assert "returned non-zero exit status" in str (error . value )
452452
453453
454454@patch (
@@ -463,4 +463,4 @@ def test_git_clone_repo_codecommit_https_creds_not_stored_locally(mkdtemp, check
463463 entry_point = "entry_point"
464464 with pytest .raises (subprocess .CalledProcessError ) as error :
465465 git_utils .git_clone_repo (git_config , entry_point )
466- assert "returned non-zero exit status" in str (error )
466+ assert "returned non-zero exit status" in str (error . value )
0 commit comments