File: basic-test.sh

package info (click to toggle)
python-hypothesis 3.6.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,788 kB
  • sloc: python: 15,048; sh: 226; makefile: 160
file content (74 lines) | stat: -rwxr-xr-x 1,739 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -e -o xtrace

# We run a reduced set of tests on OSX mostly so the CI runs in vaguely
# reasonable time.
if [[ "$(uname -s)" == 'Darwin' ]]; then
    DARWIN=true
else
    DARWIN=false
fi

python -c '
import os
for k, v in sorted(dict(os.environ).items()):
    print("%s=%s" % (k, v))
'

pip install .


PYTEST="python -m pytest"

$PYTEST tests/cover

if [ "$(python -c 'import sys; print(sys.version_info[0] == 2)')" = "True" ] ; then
    $PYTEST tests/py2
else
    $PYTEST tests/py3
fi

$PYTEST --runpytest=subprocess tests/pytest

if [ "$DARWIN" != true ]; then
  for f in tests/nocover/test_*.py; do
    $PYTEST $f
  done
fi


pip install .[datetime]
$PYTEST tests/datetime/
pip uninstall -y pytz

if [ "$DARWIN" = true ]; then
  exit 0
fi

# fake-factory doesn't have a correct universal wheel
pip install --no-use-wheel faker
$PYTEST tests/fakefactory/
pip uninstall -y faker

if [ "$(python -c 'import platform; print(platform.python_implementation())')" != "PyPy" ]; then
  if [ "$(python -c 'import sys; print(sys.version_info[:2] <= (2, 6))')" != "True" ] ; then
  if [ "$(python -c 'import sys; print(sys.version_info[0] == 2 or sys.version_info[:2] >= (3, 4))')" == "True" ] ; then
    pip install .[django]
    python -m tests.django.manage test tests.django
    pip uninstall -y django
  fi
  fi

  if [ "$(python -c 'import sys; print(sys.version_info[:2] < (3, 5))')" = "True" ] ; then
    if [ "$(python -c 'import sys; print(sys.version_info[:2] <= (2, 6))')" != "True" ] ; then
      pushd $HOME
        pip wheel numpy==1.9.2
      popd
      pip install --find-links=$HOME/wheelhouse numpy==1.9.2
    else
      pip install numpy==1.9.2
    fi
    $PYTEST tests/numpy
    pip uninstall -y numpy
  fi
fi