changeset 883:bc925f4aa978

Correct PYTHONPATH when testing applications.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 09 Aug 2008 14:43:17 +0200
parents 794a38489a2d
children 74860b8b1b98
files viff/test/test_apps.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/test/test_apps.py	Fri Aug 08 13:51:18 2008 +0200
+++ b/viff/test/test_apps.py	Sat Aug 09 14:43:17 2008 +0200
@@ -43,8 +43,12 @@
 
     def setUp(self):
         """Switch to apps/ directory and generate config files."""
+        root_dir = path.abspath(path.join(path.dirname(__file__), "..", ".."))
+        if root_dir not in os.environ["PYTHONPATH"]:
+            os.environ["PYTHONPATH"] += os.pathsep + root_dir
+
         self.oldcwd = os.getcwd()
-        os.chdir(path.join(path.dirname(__file__), '..', '..', 'apps'))
+        os.chdir(path.join(root_dir, 'apps'))
 
         p = execute('generate-config-files.py', '-n', '3', '-t', '1',
                     'localhost:10000', 'localhost:20000', 'localhost:30000')