diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2013-10-05 19:36:12 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2013-10-05 19:36:12 +0400 |
commit | d18b257f45727b56e9e9c8b9f8f8d6674feaba60 (patch) | |
tree | 56b6bdae77ef9db679913a1eaf8deb2c583e2422 /tests | |
parent | 5fc02b3ee0d40194243d1b3a413a6ad61f3c90be (diff) | |
download | sphinx-d18b257f45727b56e9e9c8b9f8f8d6674feaba60.tar.gz |
Make sure setup_command test can always import Sphinx
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_setup_command.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py index af4b75c0..7bdd1901 100644 --- a/tests/test_setup_command.py +++ b/tests/test_setup_command.py @@ -14,6 +14,7 @@ import sys import subprocess from functools import wraps import tempfile +import sphinx from util import with_tempdir, test_roots, SkipTest from path import path @@ -35,11 +36,15 @@ def with_setup_command(root, *args, **kwds): root.copytree(pkgrootdir) cwd = os.getcwd() os.chdir(pkgrootdir) + pythonpath = os.path.dirname(os.path.dirname(sphinx.__file__)) + if os.getenv('PYTHONPATH'): + pythonpath = os.getenv('PYTHONPATH') + os.pathsep + pythonpath command = [sys.executable, 'setup.py', 'build_sphinx'] command.extend(args) try: proc = subprocess.Popen( command, + env=dict(os.environ, PYTHONPATH=pythonpath), stdout=subprocess.PIPE, stderr=subprocess.PIPE) func(pkgrootdir, proc, *args, **kwds) |