Debian Codegraph @

hypothesis-python/scripts/basic-test.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 set -e -o xtrace
3
4 HERE="$( cd "$( dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}" )" && pwdscip-shell system . . pwd. )"
5 cd "$HERE/.."
6
7 python -c '
8 import os
9 for k, v in sorted(dict(os.environ).items()):
10 print("%s=%s" % (k, v))
11 '
12
13 pipscip-shell system . . pip. install .
14
15
16 PYTEST="python -bb -X dev -m pytest -nauto --durations-min=1.0"
17
18 # Run all the no-extra-dependency tests for this version (except slow nocover tests)
19 $PYTEST tests/cover tests/pytest
20
21 # Run tests for each extra module while the requirements are installed
22 pipscip-shell system . . pip. install ".[pytz, dateutil, zoneinfo]"
23 $PYTEST tests/datetime/
24 pipscip-shell system . . pip. uninstall -y pytz python-dateutil
25
26 pipscip-shell system . . pip. install ".[dpcontracts]"
27 $PYTEST tests/dpcontracts/
28 pipscip-shell system . . pip. uninstall -y dpcontracts
29
30 # use pinned redis version instead of inheriting from fakeredis
31 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. '^redis==' ../requirements/coverage.txt)"
32 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'fakeredis==' ../requirements/coverage.txt)"
33 $PYTEST tests/redis/
34 pipscip-shell system . . pip. uninstall -y redis fakeredis
35
36 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'typing-extensions==' ../requirements/coverage.txt)"
37 $PYTEST tests/typing_extensions/
38 pipscip-shell system . . pip. uninstall -y typing_extensions
39
40 pipscip-shell system . . pip. install ".[lark]"
41 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. -m 1 -oE 'lark>=([0-9.]+)' ../hypothesis-python/pyproject.toml | trscip-shell system . . tr. '>' =)"
42 $PYTEST -Wignore tests/lark/
43 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'lark==' ../requirements/coverage.txt)"
44 $PYTEST tests/lark/
45 pipscip-shell system . . pip. uninstall -y lark
46
47 if [scip-shell system . . `[`. "$(python -c $'import platform, sys; print(sys.version_info.releaselevel == \'final\' and platform.python_implementation() not in ("PyPy", "GraalVM"))')" = "True" ] ; then
48 pipscip-shell system . . pip. install ".[codemods,cli]"
49 $PYTEST tests/codemods/
50 pipscip-shell system . . pip. uninstall -y libcst click
51
52 if [scip-shell system . . `[`. "$(python -c 'import sys; print(sys.version_info[:2] == (3, 10))')" = "True" ] ; then
53 # Per NEP-29, this is the last version to support Python 3.10
54 pipscip-shell system . . pip. install numpy==2.2.6
55 else
56 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'numpy==' ../requirements/coverage.txt)"
57 fi
58
59 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. -E 'black(==| @)' ../requirements/coverage.txt)"
60 $PYTEST tests/ghostwriter/
61 pipscip-shell system . . pip. uninstall -y black numpy
62 fi
63
64 if [scip-shell system . . `[`. "$(python -c 'import sys; print(sys.version_info[:2] == (3, 10))')" = "False" ] ; then
65 exit 0
66 fi
67
68 $PYTEST tests/nocover/
69
70 # Run some tests without docstrings or assertions, to catch bugs
71 # like issue #822 in one of the test decorators. See also #1541.
72 PYTHONOPTIMIZE=2 $PYTEST \
73 -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' \
74 -W'ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning' \
75 tests/cover/test_testdecorators.py
76
77 case "$(python -c 'import platform; print(platform.python_implementation())')" in
78 PyPy|GraalVM)
79 ;;
80 *)
81 pipscip-shell system . . pip. install .[django]
82 HYPOTHESIS_DJANGO_USETZ=TRUE python -m tests.django.manage test tests.django
83 HYPOTHESIS_DJANGO_USETZ=FALSE python -m tests.django.manage test tests.django
84 pipscip-shell system . . pip. uninstall -y django pytz
85
86 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'numpy==' ../requirements/coverage.txt)"
87 $PYTEST tests/array_api
88 $PYTEST tests/numpy
89
90 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'pandas==' ../requirements/coverage.txt)"
91 $PYTEST tests/pandas
92 esac