Skip to content

Commit e308497

Browse files
authored
Merge pull request #6743 from chrahunt/maint/remove-path-copytree
Remove copytree from tests.lib.path.Path.
2 parents 0d28601 + 9281a7a commit e308497

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def virtualenv_template(request, tmpdir_factory, pip_src,
239239
# Install setuptools and pip.
240240
install_egg_link(venv, 'setuptools', setuptools_install)
241241
pip_editable = Path(str(tmpdir_factory.mktemp('pip'))) / 'pip'
242-
pip_src.copytree(pip_editable)
242+
shutil.copytree(pip_src, pip_editable, symlinks=True)
243243
assert compileall.compile_dir(str(pip_editable), quiet=1)
244244
subprocess.check_call([venv.bin / 'python', 'setup.py', '-q', 'develop'],
245245
cwd=pip_editable)

tests/lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def reset(self):
143143
# try/except.
144144
if self.root.exists():
145145
shutil.rmtree(self.root)
146-
self.source.copytree(self.root)
146+
shutil.copytree(self.source, self.root, symlinks=True)
147147

148148
@property
149149
def packages(self):

tests/lib/path.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ def rmdir(self):
179179
"""
180180
return os.rmdir(self)
181181

182-
def copytree(self, to):
183-
"""
184-
Copies a directory tree to another path.
185-
"""
186-
return shutil.copytree(self, to, symlinks=True)
187-
188182
def rename(self, to):
189183
"""
190184
Renames a file or directory. May throw an OSError.

tests/lib/venv.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def _create(self, clear=False):
5555
if sys.platform == 'win32' and self.location.exists():
5656
self.location.rmdir()
5757
# Clone virtual environment from template.
58-
self._template.location.copytree(self.location)
58+
shutil.copytree(
59+
self._template.location, self.location, symlinks=True
60+
)
5961
self._sitecustomize = self._template.sitecustomize
6062
self._user_site_packages = self._template.user_site_packages
6163
else:

0 commit comments

Comments
 (0)