@@ -40,7 +40,7 @@ def _get_branch_remote(script, package_name, branch):
40
40
return result .stdout .strip ()
41
41
42
42
43
- def _github_checkout (url_path , temp_dir , egg = None , scheme = None ):
43
+ def _github_checkout (url_path , temp_dir , rev = None , egg = None , scheme = None ):
44
44
"""
45
45
Call local_checkout() with a GitHub URL, and return the resulting URL.
46
46
@@ -56,6 +56,8 @@ def _github_checkout(url_path, temp_dir, egg=None, scheme=None):
56
56
scheme = 'https'
57
57
url = 'git+{}://github.com/{}' .format (scheme , url_path )
58
58
local_url = local_checkout (url , temp_dir .join ('cache' ))
59
+ if rev is not None :
60
+ local_url += '@{}' .format (rev )
59
61
if egg is not None :
60
62
local_url += '#egg={}' .format (egg )
61
63
@@ -150,7 +152,7 @@ def test_install_editable_from_git_with_https(script, tmpdir):
150
152
"""
151
153
url_path = 'pypa/pip-test-package.git'
152
154
local_url = _github_checkout (url_path , tmpdir , egg = 'pip-test-package' )
153
- result = script .pip ('install' , '-e' , local_url , expect_error = True )
155
+ result = script .pip ('install' , '-e' , local_url )
154
156
result .assert_installed ('pip-test-package' , with_files = ['.git' ])
155
157
156
158
@@ -272,14 +274,13 @@ def test_git_with_tag_name_and_update(script, tmpdir):
272
274
"""
273
275
url_path = 'pypa/pip-test-package.git'
274
276
local_url = _github_checkout (url_path , tmpdir , egg = 'pip-test-package' )
275
- result = script .pip ('install' , '-e' , local_url , expect_error = True )
277
+ result = script .pip ('install' , '-e' , local_url )
276
278
result .assert_installed ('pip-test-package' , with_files = ['.git' ])
277
279
278
280
new_local_url = _github_checkout (url_path , tmpdir )
279
281
new_local_url += '@0.1.2#egg=pip-test-package'
280
282
result = script .pip (
281
283
'install' , '--global-option=--version' , '-e' , new_local_url ,
282
- expect_error = True ,
283
284
)
284
285
assert '0.1.2' in result .stdout
285
286
@@ -292,7 +293,7 @@ def test_git_branch_should_not_be_changed(script, tmpdir):
292
293
"""
293
294
url_path = 'pypa/pip-test-package.git'
294
295
local_url = _github_checkout (url_path , tmpdir , egg = 'pip-test-package' )
295
- script .pip ('install' , '-e' , local_url , expect_error = True )
296
+ script .pip ('install' , '-e' , local_url )
296
297
branch = _get_editable_branch (script , 'pip-test-package' )
297
298
assert 'master' == branch
298
299
@@ -302,11 +303,11 @@ def test_git_with_non_editable_unpacking(script, tmpdir):
302
303
"""
303
304
Test cloning a git repository from a non-editable URL with a given tag.
304
305
"""
305
- url_path = 'pypa/[email protected] #egg=pip-test-package'
306
- local_url = _github_checkout (url_path , tmpdir )
307
- result = script .pip (
308
- 'install' , '--global-option=--version' , local_url , expect_error = True ,
306
+ url_path = 'pypa/pip-test-package.git'
307
+ local_url = _github_checkout (
308
+ url_path , tmpdir , rev = '0.1.2' , egg = 'pip-test-package' ,
309
309
)
310
+ result = script .pip ('install' , '--global-option=--version' , local_url )
310
311
assert '0.1.2' in result .stdout
311
312
312
313
@@ -465,7 +466,6 @@ def test_check_submodule_addition(script):
465
466
update_result = script .pip (
466
467
'install' , '-e' , 'git+' + module_path + '#egg=version_pkg' ,
467
468
'--upgrade' ,
468
- expect_error = True ,
469
469
)
470
470
471
471
assert (
0 commit comments