--- a/doc/testdocs
+++ b/doc/testdocs
@@ -12,6 +12,18 @@
 export PYTHONPATH="examples:$PYTHONPATH"
 
 PYTHON="python2.5 -Wd"
+
+# Go to doc directory:
+cd `dirname "$0"`
+
+# Add parent directory to PYTHONPATH:
+parent_dir=$(dirname $(pwd))
+if [ "$PYTHONPATH" ]
+then
+    export PYTHONPATH="$parent_dir:$PYTHONPATH"
+else
+    export PYTHONPATH="$parent_dir"
+fi
 
 if [ $# -ge 2 -a "x$1" = x-p ]
 then