-
Notifications
You must be signed in to change notification settings - Fork 575
/
other-tests.sh
75 lines (60 loc) · 2.57 KB
/
other-tests.sh
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
75
#!/bin/bash
set -e -o xtrace
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$HERE/.."
pip install .
PYTEST="python -bb -X dev -m pytest -nauto --durations-min=1.0"
# Run some tests without docstrings or assertions, to catch bugs
# like issue #822 in one of the test decorators. See also #1541.
PYTHONOPTIMIZE=2 $PYTEST \
-W'ignore:assertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter:pytest.PytestConfigWarning' \
-W'ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning' \
tests/cover/test_testdecorators.py
# Run tests for each extra module while the requirements are installed
pip install ".[pytz, dateutil, zoneinfo]"
$PYTEST tests/datetime/
pip uninstall -y pytz python-dateutil
pip install ".[dpcontracts]"
$PYTEST tests/dpcontracts/
pip uninstall -y dpcontracts
pip install "$(grep 'fakeredis==' ../requirements/coverage.txt)"
pip install "$(grep 'typing-extensions==' ../requirements/coverage.txt)"
$PYTEST tests/redis/
pip uninstall -y redis fakeredis
$PYTEST tests/typing_extensions/
pip uninstall -y typing_extensions
if [ "$(python -c 'import sys; print(sys.version_info[:2] >= (3, 9))')" = "True" ] ; then
pip install "$(grep 'annotated-types==' ../requirements/coverage.txt)"
$PYTEST tests/test_annotated_types.py
pip uninstall -y annotated-types
fi
pip install ".[lark]"
pip install "$(grep -oE 'lark>=([0-9.]+)' ../hypothesis-python/setup.py | tr '>' =)"
$PYTEST -Wignore tests/lark/
pip install "$(grep 'lark==' ../requirements/coverage.txt)"
$PYTEST tests/lark/
pip uninstall -y lark
if [ "$(python -c $'import platform, sys; print(sys.version_info.releaselevel == \'final\' and platform.python_implementation() not in ("PyPy", "GraalVM"))')" = "True" ] ; then
pip install ".[codemods,cli]"
$PYTEST tests/codemods/
pip install "$(grep -E 'black(==| @)' ../requirements/coverage.txt)"
if [ "$(python -c 'import sys; print(sys.version_info[:2] >= (3, 9))')" = "True" ] ; then
$PYTEST tests/patching/
fi
pip uninstall -y libcst
if [ "$(python -c 'import sys; print(sys.version_info[:2] == (3, 8))')" = "True" ] ; then
# Per NEP-29, this is the last version to support Python 3.8
pip install numpy==1.24.3
else
pip install "$(grep 'numpy==' ../requirements/coverage.txt)"
fi
case "$(python -c 'import platform; print(platform.python_implementation())')" in
PyPy|GraalVM)
;;
*)
$PYTEST tests/array_api
$PYTEST tests/numpy
esac
$PYTEST tests/ghostwriter/
pip uninstall -y black numpy
fi