Skip to content

Commit 347900b

Browse files
authored
Merge pull request pytest-dev#37 from jcfr/pytest-virtualenv_install-package_support-windows
virtualenv/install_package: Add support for windows
2 parents 37c8c6b + c0dd757 commit 347900b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎pytest-virtualenv/pytest_virtualenv.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ def install_package(self, pkg_name, installer='easy_install', build_egg=None):
170170
"""
171171
installed = [p for p in working_set if p.project_name == pkg_name]
172172
if not installed or installed[0].location.endswith('.egg'):
173-
installer = str(self.virtualenv / 'bin' / installer)
173+
if sys.platform == 'win32':
174+
# In virtualenv on windows "Scripts" folder is used instead of "bin".
175+
installer = str(self.virtualenv / 'Scripts' / installer + '.exe')
176+
else:
177+
installer = str(self.virtualenv / 'bin' / installer)
174178
if not self.debug:
175179
installer += ' -q'
176180
# Note we're running this as 'python easy_install foobar', instead of 'easy_install foobar'

0 commit comments

Comments
 (0)