diff options
| author | holger krekel <holger@merlinux.eu> | 2012-11-05 13:34:02 +0100 |
|---|---|---|
| committer | holger krekel <holger@merlinux.eu> | 2012-11-05 13:34:02 +0100 |
| commit | 523e40f50b9fdf4a3b96e4b5f0eaa92acda98102 (patch) | |
| tree | f78964c213db88b0316f494aa28bf92d104904b4 | |
| parent | aaa3eb3c8437cb90ccaef9de61656ed248315d52 (diff) | |
| download | tox-523e40f50b9fdf4a3b96e4b5f0eaa92acda98102.tar.gz | |
add a test for find_executable()
| -rw-r--r-- | tests/test_venv.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_venv.py b/tests/test_venv.py index f3023ae..4fa0ad0 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -3,6 +3,7 @@ import tox import pytest import os, sys from tox._venv import VirtualEnv, CreationConfig, getdigest +from tox._venv import find_executable #def test_global_virtualenv(capfd): # v = VirtualEnv() @@ -32,7 +33,6 @@ def test_locate_via_py(monkeypatch): assert locate_via_py('3', '2') == sys.executable def test_find_executable(): - from tox._venv import find_executable p = find_executable(sys.executable) assert p == py.path.local(sys.executable) for ver in [""] + "2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3".split(): @@ -53,6 +53,14 @@ def test_find_executable(): stdout, stderr = popen.communicate() assert ver in py.builtin._totext(stderr, "ascii") +def test_find_executable_extra(monkeypatch): + @staticmethod + def sysfind(x): + return "hello" + monkeypatch.setattr(py.path.local, "sysfind", sysfind) + t = find_executable("qweqwe") + assert t == "hello" + def test_getsupportedinterpreter(monkeypatch, newconfig, mocksession): config = newconfig([], """ [testenv:python] |
