Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove copytree from tests.lib.path.Path. #6743

Merged
merged 1 commit into from Jul 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/conftest.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/__init__.py
Expand Up @@ -143,7 +143,7 @@ def reset(self):
# 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):
Expand Down
6 changes: 0 additions & 6 deletions tests/lib/path.py
Expand Up @@ -179,12 +179,6 @@ def rmdir(self):
"""
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.
Expand Down
4 changes: 3 additions & 1 deletion tests/lib/venv.py
Expand Up @@ -55,7 +55,9 @@ def _create(self, clear=False):
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:
Expand Down