summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@gmail.com>2019-07-21 09:28:01 +0530
committerGitHub <noreply@github.com>2019-07-21 09:28:01 +0530
commite308497416e172b48e2d49a226f4d3e0b71a2a5f (patch)
treea58982a5bc54843d0a731c7f6e69c0c06bc53958
parent0d286012f79784b05bd1ddbbe9ead01dcfb844fe (diff)
parent9281a7aac19a55ee85a631a148277f2863efd6ac (diff)
downloadpip-e308497416e172b48e2d49a226f4d3e0b71a2a5f.tar.gz
Merge pull request #6743 from chrahunt/maint/remove-path-copytree
Remove copytree from tests.lib.path.Path.
-rw-r--r--tests/conftest.py2
-rw-r--r--tests/lib/__init__.py2
-rw-r--r--tests/lib/path.py6
-rw-r--r--tests/lib/venv.py4
4 files changed, 5 insertions, 9 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 578033336..d1a12d65e 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -239,7 +239,7 @@ def virtualenv_template(request, tmpdir_factory, pip_src,
# Install setuptools and pip.
install_egg_link(venv, 'setuptools', setuptools_install)
pip_editable = Path(str(tmpdir_factory.mktemp('pip'))) / 'pip'
- pip_src.copytree(pip_editable)
+ shutil.copytree(pip_src, pip_editable, symlinks=True)
assert compileall.compile_dir(str(pip_editable), quiet=1)
subprocess.check_call([venv.bin / 'python', 'setup.py', '-q', 'develop'],
cwd=pip_editable)
diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py
index a253b40ed..61fcc9547 100644
--- a/tests/lib/__init__.py
+++ b/tests/lib/__init__.py
@@ -143,7 +143,7 @@ class TestData(object):
# try/except.
if self.root.exists():
shutil.rmtree(self.root)
- self.source.copytree(self.root)
+ shutil.copytree(self.source, self.root, symlinks=True)
@property
def packages(self):
diff --git a/tests/lib/path.py b/tests/lib/path.py
index 42e89079b..cb2e6bda7 100644
--- a/tests/lib/path.py
+++ b/tests/lib/path.py
@@ -179,12 +179,6 @@ class Path(_base):
"""
return os.rmdir(self)
- def copytree(self, to):
- """
- Copies a directory tree to another path.
- """
- return shutil.copytree(self, to, symlinks=True)
-
def rename(self, to):
"""
Renames a file or directory. May throw an OSError.
diff --git a/tests/lib/venv.py b/tests/lib/venv.py
index f78ecbb92..5ef9adc87 100644
--- a/tests/lib/venv.py
+++ b/tests/lib/venv.py
@@ -55,7 +55,9 @@ class VirtualEnvironment(object):
if sys.platform == 'win32' and self.location.exists():
self.location.rmdir()
# Clone virtual environment from template.
- self._template.location.copytree(self.location)
+ shutil.copytree(
+ self._template.location, self.location, symlinks=True
+ )
self._sitecustomize = self._template.sitecustomize
self._user_site_packages = self._template.user_site_packages
else: