mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-13 19:15:15 +01:00
test: test_python: set PYTHONPATH to the python execution environment
Place PYTHONPATH to the environment when python is executed in a way that current shell environment is not affected. This also allows adding the old value of PYTHONPATH to the end of the new value (otherwise it would have been appended again and again when test_python is called). At the same time, use -B option to avoid writing .pyc files to bindings/python/* (which are not cleared out by distclean). Drop the (unused) prefix code which preserved the original stdout of the python program and opened sys.stdout to OUTPUT. In place of that there is now note how (debug) information can be printed to original stdout.
This commit is contained in:
parent
f0e5317bcd
commit
2333a44ab7
1 changed files with 4 additions and 4 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue