forked from google/python-subprocess32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·27 lines (23 loc) · 863 Bytes
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash -ex
# This is for my own convenience, edit it for your own environment.
PYTHON=python2
"$PYTHON" -V
"$PYTHON" setup.py build
export PYTHONPATH=build/lib.linux-x86_64-2.7
exec "$PYTHON" test_subprocess32.py
PYTHON=python3
rm -r vvv dist
mkdir vvv
# Test this in a virtualenv installed from the sdist tarball becaue of:
# https://github.com/google/python-subprocess32/issues/44
virtualenv -p "$PYTHON" vvv
PYTHON=vvv/bin/python3
PIP=vvv/bin/pip
"$PYTHON" -V
"$PYTHON" setup.py sdist
"$PIP" install dist/*.tar.gz
# Merely test that it imports. Under Python 3, setup.py should've installed a
# redirection hack making subprocess32 == subprocess. We cd as we must not run
# this from the directory subprocess32.py sources live in.
(cd $(dirname "$PYTHON") && \
./python3 -c "import subprocess as s, subprocess32 as s32; assert s is s32, (s, s32)")