@pytest.fixture
def setup_command(request, tempdir):
 marker = request.node.get_marker('setup_command')
 args = (marker.args if marker else [])
 pkgrootdir = (tempdir / 'root')
 root.copytree(pkgrootdir)
 with cd(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)
  proc = subprocess.Popen(command, env=dict(os.environ, PYTHONPATH=pythonpath), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  (yield namedtuple('setup', 'pkgroot,proc')(pkgrootdir, proc))

@ pytest . fixture def setup_command ( request , tempdir ) : marker = request . node . get_marker ( 'setup_command' ) args = ( marker . args if marker else [ ] ) pkgrootdir = ( tempdir / 'root' ) root . copytree ( pkgrootdir ) with cd ( 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 ) proc = subprocess . Popen ( command , env = dict ( os . environ , PYTHONPATH = pythonpath ) , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) ( yield namedtuple ( 'setup' , 'pkgroot,proc' ) ( pkgrootdir , proc ) )
run setup .