unittest: start server in a modified environment.

This changes allows the user to run the unittests properly in
a virtualenv setup. Once the venv activated, /usr/bin/env
will point the python executable within the venv instead of
the system one.

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
This commit is contained in:
Emmanuel Roullit 2015-07-20 11:59:40 +02:00
parent 49c3c6c6be
commit 485f2203e0
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ class TestGlances(unittest.TestCase):
global pid
cmdline = "/usr/bin/python -m glances -w -p %s" % SERVER_PORT
cmdline = "/usr/bin/env python -m glances -w -p %s" % SERVER_PORT
print("Run the Glances Web Server on port %s" % SERVER_PORT)
args = shlex.split(cmdline)
pid = subprocess.Popen(args)

View File

@ -86,7 +86,7 @@ class TestGlances(unittest.TestCase):
global pid
cmdline = "/usr/bin/python -m glances -s -p %s" % SERVER_PORT
cmdline = "/usr/bin/env python -m glances -s -p %s" % SERVER_PORT
print("Run the Glances Server on port %s" % SERVER_PORT)
args = shlex.split(cmdline)
pid = subprocess.Popen(args)