Skip to content

Commit 7e10908

Browse files
committed
Remove unneeded expect_error=True in some vcs tests.
1 parent e0e07bf commit 7e10908

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/functional/test_install_vcs_git.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _get_branch_remote(script, package_name, branch):
4040
return result.stdout.strip()
4141

4242

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):
4444
"""
4545
Call local_checkout() with a GitHub URL, and return the resulting URL.
4646
@@ -56,6 +56,8 @@ def _github_checkout(url_path, temp_dir, egg=None, scheme=None):
5656
scheme = 'https'
5757
url = 'git+{}://github.com/{}'.format(scheme, url_path)
5858
local_url = local_checkout(url, temp_dir.join('cache'))
59+
if rev is not None:
60+
local_url += '@{}'.format(rev)
5961
if egg is not None:
6062
local_url += '#egg={}'.format(egg)
6163

@@ -150,7 +152,7 @@ def test_install_editable_from_git_with_https(script, tmpdir):
150152
"""
151153
url_path = 'pypa/pip-test-package.git'
152154
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)
154156
result.assert_installed('pip-test-package', with_files=['.git'])
155157

156158

@@ -272,14 +274,13 @@ def test_git_with_tag_name_and_update(script, tmpdir):
272274
"""
273275
url_path = 'pypa/pip-test-package.git'
274276
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)
276278
result.assert_installed('pip-test-package', with_files=['.git'])
277279

278280
new_local_url = _github_checkout(url_path, tmpdir)
279281
new_local_url += '@0.1.2#egg=pip-test-package'
280282
result = script.pip(
281283
'install', '--global-option=--version', '-e', new_local_url,
282-
expect_error=True,
283284
)
284285
assert '0.1.2' in result.stdout
285286

@@ -292,7 +293,7 @@ def test_git_branch_should_not_be_changed(script, tmpdir):
292293
"""
293294
url_path = 'pypa/pip-test-package.git'
294295
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)
296297
branch = _get_editable_branch(script, 'pip-test-package')
297298
assert 'master' == branch
298299

@@ -302,11 +303,11 @@ def test_git_with_non_editable_unpacking(script, tmpdir):
302303
"""
303304
Test cloning a git repository from a non-editable URL with a given tag.
304305
"""
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',
309309
)
310+
result = script.pip('install', '--global-option=--version', local_url)
310311
assert '0.1.2' in result.stdout
311312

312313

@@ -465,7 +466,6 @@ def test_check_submodule_addition(script):
465466
update_result = script.pip(
466467
'install', '-e', 'git+' + module_path + '#egg=version_pkg',
467468
'--upgrade',
468-
expect_error=True,
469469
)
470470

471471
assert (

0 commit comments

Comments
 (0)