Commits

Takayuki Shimizukawa  committed f29aadd Merge

Merged in mitya57/sphinx (pull request #176)

Make sure setup_command test can always import Sphinx

  • Participants
  • Parent commits 86e5949, 72d25c9

Comments (0)

Files changed (1)

File tests/test_setup_command.py

 import subprocess
 from functools import wraps
 import tempfile
+import sphinx
 
 from util import with_tempdir, test_roots, SkipTest
 from path import path
             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)