summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-02-19 15:06:55 +0100
committerholger krekel <holger@merlinux.eu>2013-02-19 15:06:55 +0100
commitd5fd258b753401cfadf8b5abe29441ddca76bf35 (patch)
tree7d7d818767de1b4575f53b50fd69a92f9f69d595
parent30a7b7000176bbbb5766bb2a4ca7f3943b157a5d (diff)
downloadtox-d5fd258b753401cfadf8b5abe29441ddca76bf35.tar.gz
fix issue84 - pypy on windows creates a bin not a scripts venv directory
(thanks Lukasz Balcerzak)
-rwxr-xr-xCHANGELOG3
-rw-r--r--tests/test_config.py13
-rw-r--r--tox/_config.py3
3 files changed, 14 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5e9a378..561d52f 100755
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,9 @@
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
diff --git a/tests/test_config.py b/tests/test_config.py
index 40d6941..9e088d4 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -1,4 +1,5 @@
import tox
+import pytest
import os, sys
from textwrap import dedent
@@ -362,14 +363,18 @@ class TestConfigTestEnv:
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("""
diff --git a/tox/_config.py b/tox/_config.py
index 9d97aed..9bc0d0f 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -113,7 +113,8 @@ class VenvConfig:
@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")