]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: test_python: set PYTHONPATH to the python execution environment
[notmuch] / test / test-lib.sh
index b0ee253c94426290373711dbbe946ed7f9935ff6..54c65b60247d7aff4c3131bb9cff8159fdc43c43 100644 (file)
@@ -1192,10 +1192,10 @@ test_emacs () {
 }
 
 test_python() {
-       export PYTHONPATH=$TEST_DIRECTORY/../bindings/python
-
-       (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \
-               | $NOTMUCH_PYTHON -
+    # Note: if there is need to print debug information from python program,
+    # use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w')
+    PYTHONPATH="$TEST_DIRECTORY/../bindings/python${PYTHONPATH:+:$PYTHONPATH}" \
+       $NOTMUCH_PYTHON -B - > OUTPUT
 }
 
 test_ruby() {