From 1ca61e14ba43c1316acab3c5eacf903647a1d8cb Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Sat, 21 Sep 2019 02:29:38 -0700 Subject: [PATCH] Assert that repo_url_path doesn't exist. --- tests/functional/test_install_vcs_git.py | 7 ++++--- tests/lib/local_repos.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/functional/test_install_vcs_git.py b/tests/functional/test_install_vcs_git.py index feb9ef040..e19745bb8 100644 --- a/tests/functional/test_install_vcs_git.py +++ b/tests/functional/test_install_vcs_git.py @@ -276,12 +276,13 @@ def test_git_with_tag_name_and_update(script, tmpdir): Test cloning a git repository and updating to a different version. """ url_path = 'pypa/pip-test-package.git' - local_url = _github_checkout(url_path, tmpdir, egg='pip-test-package') + base_local_url = _github_checkout(url_path, tmpdir) + + local_url = '{}#egg=pip-test-package'.format(base_local_url) result = script.pip('install', '-e', local_url) result.assert_installed('pip-test-package', with_files=['.git']) - new_local_url = _github_checkout(url_path, tmpdir) - new_local_url += '@0.1.2#egg=pip-test-package' + new_local_url = '{}@0.1.2#egg=pip-test-package'.format(base_local_url) result = script.pip( 'install', '--global-option=--version', '-e', new_local_url, ) diff --git a/tests/lib/local_repos.py b/tests/lib/local_repos.py index 5876f0de6..fe896f7f3 100644 --- a/tests/lib/local_repos.py +++ b/tests/lib/local_repos.py @@ -66,6 +66,7 @@ def local_checkout( else: repository_name = os.path.basename(remote_repo) repo_url_path = os.path.join(directory, repository_name) + assert not os.path.exists(repo_url_path) vcs_backend = vcs.get_backend(vcs_name) vcs_backend.obtain(repo_url_path, url=hide_url(remote_repo))