summaryrefslogtreecommitdiff
path: root/cherrypy/test/helper.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2010-04-24 20:07:19 +0000
committerRobert Brewer <fumanchu@aminus.org>2010-04-24 20:07:19 +0000
commitd678e5af58d89f8db429698a2c9d796df48ff35f (patch)
treebf4f3bde0b8c0d70ae59da3802b28ea73b8f6f1d /cherrypy/test/helper.py
parent102c2efcb479232506c2dca5f83fdd64172db888 (diff)
downloadcherrypy-d678e5af58d89f8db429698a2c9d796df48ff35f.tar.gz
Fixed test_states import of cherrypy.
Diffstat (limited to 'cherrypy/test/helper.py')
-rw-r--r--cherrypy/test/helper.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cherrypy/test/helper.py b/cherrypy/test/helper.py
index 8b639086..02810c5b 100644
--- a/cherrypy/test/helper.py
+++ b/cherrypy/test/helper.py
@@ -268,10 +268,14 @@ server.ssl_private_key: r'%s'
if self.daemonize:
args.append('-d')
+ env = os.environ.copy()
+ # Make sure we import the cherrypy package in which this module is defined.
+ grandparentdir = os.path.join(thisdir, '..', '..')
+ env['PATH'] = grandparentdir + os.pathsep + env['PATH']
if self.wait:
- self.exit_code = os.spawnl(os.P_WAIT, sys.executable, *args)
+ self.exit_code = os.spawnve(os.P_WAIT, sys.executable, args, env)
else:
- os.spawnl(os.P_NOWAIT, sys.executable, *args)
+ os.spawnve(os.P_NOWAIT, sys.executable, args, env)
cherrypy._cpserver.wait_for_occupied_port(self.host, self.port)
# Give the engine a wee bit more time to finish STARTING