Commits

holger krekel committed 638b892

make sure virtualenv commands are found first

Comments (0)

Files changed (10)

 1.5.0.dev
 -----------------
 
+- make sure test commands are searched first in the virtualenv 
+
+- rename README.txt to README.rst to make bitbucket happier
+
 - re-fix issue2 - add command_whitelist to be used in ``[testenv*]``
   sections, allowing to avoid warnings for commands such as ``make``,
   used from the commands value.
+
+What is Tox?
+--------------------
+
+Tox as is a generic virtualenv_ management and test command line tool you can use for:
+
+* checking your package installs correctly with different Python versions and
+  interpreters
+
+* running your tests in each of the environments, configuring your test tool of choice
+
+* acting as a frontend to Continuous Integration servers, greatly
+  reducing boilerplate and merging CI and shell-based testing.
+
+For more information, docs and many examples please checkout:
+
+    http://tox.testrun.org
+
+have fun,
+
+holger krekel, May 2013
+

README.txt

-
-What is Tox?
---------------------
-
-Tox as is a generic virtualenv_ management and test command line tool you can use for:
-
-* checking your package installs correctly with different Python versions and
-  interpreters
-
-* running your tests in each of the environments, configuring your test tool of choice
-
-* acting as a frontend to Continuous Integration servers, greatly
-  reducing boilerplate and merging CI and shell-based testing.
-
-For more information, docs and many examples please checkout:
-
-    http://tox.testrun.org
-
-have fun,
-
-holger krekel, May 2012
-
     unix ``make`` for running tests you can list ``whitelist_externals=make``
     or ``whitelist_externals=/usr/bin/make`` if you want more precision.
     If you don't want tox to issue a warning in any case, just use
-   ``whitelist_externals=*`` which will match all commands (not recommended).
+    ``whitelist_externals=*`` which will match all commands (not recommended).
 
 .. confval:: changedir=path
 
 from setuptools import setup
 from setuptools.command.test import test as TestCommand
 
-long_description = """
-What is Tox?
-==========================
-
-Tox as is a generic virtualenv management and test command line tool you can
-use for:
-
-* checking your package installs correctly with different
-  Python versions and interpreters
-
-* running your tests in each of the
-  environments, configuring your test tool of choice
-
-* acting as a frontend to Continuous Integration
-  servers, greatly reducing boilerplate and merging
-  CI and shell-based testing.
-
-For more information, docs and many examples please checkout the `home page`_:
-
-    http://tox.testrun.org/
-
-.. _`home page`: http://tox.testrun.org/
-"""
 
 
 class Tox(TestCommand):
     setup(
         name='tox',
         description='virtualenv-based automation of test activities',
-        long_description=long_description,
+        long_description=open("README.rst").read(),
         url='http://tox.testrun.org/',
-        version='1.5.dev9',
+        version='1.5.dev11',
         license='http://opensource.org/licenses/MIT',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
         author='holger krekel',

tests/test_venv.py

     assert interp == venv.getconfigexecutable()
     assert venv.path_config.check(exists=False)
 
+@pytest.mark.skipif("sys.platform == 'win32'")
+def test_commandpath_venv_precendence(tmpdir, monkeypatch,
+                                      mocksession, newconfig):
+    config = newconfig([], """
+        [testenv:py123]
+    """)
+    envconfig = config.envconfigs['py123']
+    venv = VirtualEnv(envconfig, session=mocksession)
+    tmpdir.ensure("easy_install")
+    monkeypatch.setenv("PATH", str(tmpdir), prepend=os.pathsep)
+    envconfig.envbindir.ensure("easy_install")
+    p = venv.getcommandpath("easy_install")
+    assert py.path.local(p).relto(envconfig.envbindir), p
+
 def test_create_distribute(monkeypatch, mocksession, newconfig):
     config = newconfig([], """
         [testenv:py123]

tests/test_z_cmdline.py

 import py
 import pytest
 import sys
-from conftest import ReportExpectMock
+from tox._pytestplugin import ReportExpectMock
 
 pytest_plugins = "pytester"
 
 #
-__version__ = '1.5.dev9'
+__version__ = '1.5.dev11'
 
 class exception:
     class Error(Exception):
             p = cwd.join(name)
             if p.check():
                 return str(p)
+        p = None
+        if venv:
+            p = py.path.local.sysfind(name, paths=[self.envconfig.envbindir])
+        if p is not None:
+            return p
         p = py.path.local.sysfind(name)
         if p is None:
-            raise tox.exception.InvocationError("could not find executable %r"
-                % (name,))
-        if p.relto(self.envconfig.envdir):
-            return p
+            raise tox.exception.InvocationError(
+                    "could not find executable %r" % (name,))
         if venv:
             for x in self.envconfig.whitelist_externals:
                 if p.fnmatch(x):
 
 """
 
-__version__ = '1.5.dev9'
+__version__ = '1.5.dev11'
 
 import sys
 import os
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.