Commits

holger krekel  committed 81a0cd4

fix issue84 - pypy on windows creates a bin not a scripts venv directory
(thanks Lukasz Balcerzak)

  • Participants
  • Parent commits 40797cc

Comments (0)

Files changed (3)

   downloadcache=PATH testenv setting is present. (The ENV setting
   takes precedence)
 
+- fix issue84 - pypy on windows creates a bin not a scripts venv directory
+  (thanks Lukasz Balcerzak)
+
 - experimentally introduce --installpkg=PATH option to install a package rather than
   create/install an sdist package.  This will still require and use
   tox.ini and tests from the current working dir (and not from the remote

File tests/test_config.py

 import tox
+import pytest
 import os, sys
 from textwrap import dedent
 
         envconfig = config.envconfigs['python']
         assert envconfig.envpython == envconfig.envbindir.join("python")
 
-    def test_envbindir_jython(self, tmpdir, newconfig):
+    @pytest.mark.parametrize("bp", ["jython", "pypy"])
+    def test_envbindir_jython(self, tmpdir, newconfig, bp):
         config = newconfig("""
             [testenv]
-            basepython=jython
-        """)
+            basepython=%s
+        """ % bp)
         assert len(config.envconfigs) == 1
         envconfig = config.envconfigs['python']
-        assert envconfig.envpython == envconfig.envbindir.join("jython")
+        # on win32 and linux virtualenv uses "bin" for pypy/jython
+        assert envconfig.envbindir.basename == "bin"
+        if bp == "jython":
+            assert envconfig.envpython == envconfig.envbindir.join(bp)
 
     def test_setenv_overrides(self, tmpdir, newconfig):
         config = newconfig("""

File tox/_config.py

 
     @property
     def envbindir(self):
-        if sys.platform == "win32" and "jython" not in self.basepython:
+        if (sys.platform == "win32" and "jython" not in self.basepython
+                                    and "pypy" not in self.basepython):
             return self.envdir.join("Scripts")
         else:
             return self.envdir.join("bin")