Commits

holger krekel committed d734365

add "py" environment using sys.executable and tox's python setup.py test
execute tox with -e py. (closes #46)

  • Participants
  • Parent commits d80c2be

Comments (0)

Files changed (7)

   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
 -----------------
 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):
         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',

tests/test_config.py

 
 import py
 from tox._config import IniReader, CommandParser
+from tox._config import parseconfig
 
 class TestVenvConfig:
     def test_config_parsing_minimal(self, tmpdir, newconfig):
 
 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()
         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 = """
 
 [testenv]
 commands=py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs}
-deps=pytest
-     py
+deps=pytest==2.3.2
 
 [testenv:docs]
 basepython=python
 #
-__version__ = '1.4.3.dev0'
+__version__ = '1.4.3.dev1'
 
 class exception:
     class Error(Exception):
 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:
 
 """
 
-__version__ = '1.4.3.dev0'
+__version__ = '1.4.3.dev1'
 
 import sys
 import os