summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2012-10-26 15:53:34 +0200
committerholger krekel <holger@merlinux.eu>2012-10-26 15:53:34 +0200
commit6ea35619dd82759e853acb01e2fcf67ab5dd5cb5 (patch)
tree42ea66a6ac4a73a489ac2fac4a364f2ddc1f551b
parent03068c0cf127bd588d295876425adfc6c5eef6e6 (diff)
downloadtox-6ea35619dd82759e853acb01e2fcf67ab5dd5cb5.tar.gz
add "py" environment using sys.executable and tox's python setup.py test
execute tox with -e py. (closes #46)
-rwxr-xr-xCHANGELOG3
-rw-r--r--setup.py4
-rw-r--r--tests/test_config.py7
-rw-r--r--tox.ini3
-rw-r--r--tox/__init__.py2
-rw-r--r--tox/_config.py8
-rw-r--r--toxbootstrap.py2
7 files changed, 19 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 18608f0..1e3cf6b 100755
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,7 +5,8 @@
indexserver url, allowing to use it to separate dependencies
into groups even if using the same default indexserver.
- look for "tox.ini" files in parent dirs of current dir (closes #34)
-
+- the "py" environment now by default uses the current interpreter (sys.executable)
+ make tox' own setup.py test execute tests with it (closes #46)
1.4.2
-----------------
diff --git a/setup.py b/setup.py
index 63acabf..6a01278 100644
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@ For more information, docs and many examples please checkout the `home page`_:
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
- self.test_args = []
+ self.test_args = ["-v", "-epy"]
self.test_suite = True
def run_tests(self):
@@ -49,7 +49,7 @@ def main():
description='virtualenv-based automation of test activities',
long_description=long_description,
url='http://tox.testrun.org/',
- version='1.4.3.dev0',
+ version='1.4.3.dev1',
license='GPLv2 or later',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel',
diff --git a/tests/test_config.py b/tests/test_config.py
index 382fc44..e5b5f7e 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -4,6 +4,7 @@ from textwrap import dedent
import py
from tox._config import IniReader, CommandParser
+from tox._config import parseconfig
class TestVenvConfig:
def test_config_parsing_minimal(self, tmpdir, newconfig):
@@ -75,7 +76,6 @@ class TestConfigPackage:
class TestParseconfig:
def test_search_parents(self, tmpdir):
- from tox._config import parseconfig
b = tmpdir.mkdir("a").mkdir("b")
toxinipath = tmpdir.ensure("tox.ini")
old = b.chdir()
@@ -667,6 +667,11 @@ class TestGlobalOptions:
config = newconfig(["-eALL"], inisource)
assert config.envlist == ['py26', 'py27', 'py31']
+ def test_py_venv(self, tmpdir, newconfig, monkeypatch):
+ config = newconfig(["-epy"], "")
+ env = config.envconfigs['py']
+ assert str(env.basepython) == sys.executable
+
def test_default_environments(self, tmpdir, newconfig, monkeypatch):
envs = "py24,py25,py26,py27,py30,py31,py32,jython,pypy"
inisource = """
diff --git a/tox.ini b/tox.ini
index 42d93c8..ec3da9a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,8 +9,7 @@ commands=echo {posargs}
[testenv]
commands=py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs}
-deps=pytest
- py
+deps=pytest==2.3.2
[testenv:docs]
basepython=python
diff --git a/tox/__init__.py b/tox/__init__.py
index 2f54cc7..e6669b6 100644
--- a/tox/__init__.py
+++ b/tox/__init__.py
@@ -1,5 +1,5 @@
#
-__version__ = '1.4.3.dev0'
+__version__ = '1.4.3.dev1'
class exception:
class Error(Exception):
diff --git a/tox/_config.py b/tox/_config.py
index 6bb3e4a..e02e25e 100644
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -10,8 +10,12 @@ import py
import tox
defaultenvs = {'jython': 'jython', 'pypy': 'pypy'}
-for _name in "py24,py25,py26,py27,py30,py31,py32,py33".split(","):
- defaultenvs[_name] = "python%s.%s" %(_name[2], _name[3])
+for _name in "py,py24,py25,py26,py27,py30,py31,py32,py33,py34".split(","):
+ if _name == "py":
+ basepython = sys.executable
+ else:
+ basepython = "python" + ".".join(_name[2:4])
+ defaultenvs[_name] = basepython
def parseconfig(args=None, pkg=None):
if args is None:
diff --git a/toxbootstrap.py b/toxbootstrap.py
index 66bdf1f..979ea6a 100644
--- a/toxbootstrap.py
+++ b/toxbootstrap.py
@@ -58,7 +58,7 @@ ToDo
"""
-__version__ = '1.4.3.dev0'
+__version__ = '1.4.3.dev1'
import sys
import os