Debian Codegraph @

hypothesis-python/scripts/other-tests.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 pipscip-shell system . . pip. install .
8
9
10 PYTEST="python -bb -X dev -m pytest -nauto --durations-min=1.0"
11
12 # Run some tests without docstrings or assertions, to catch bugs
13 # like issue #822 in one of the test decorators. See also #1541.
14 PYTHONOPTIMIZE=2 $PYTEST \
15 -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' \
16 -W'ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning' \
17 tests/cover/test_testdecorators.py
18
19 # Run tests for each extra module while the requirements are installed
20 pipscip-shell system . . pip. install ".[pytz, dateutil, zoneinfo]"
21 $PYTEST tests/datetime/
22 pipscip-shell system . . pip. uninstall -y pytz python-dateutil
23
24 pipscip-shell system . . pip. install ".[dpcontracts]"
25 $PYTEST tests/dpcontracts/
26 pipscip-shell system . . pip. uninstall -y dpcontracts
27
28 pipscip-shell system . . pip. install attrs
29 $PYTEST tests/attrs/
30 pipscip-shell system . . pip. uninstall -y attrs
31
32 # use pinned redis version instead of inheriting from fakeredis
33 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. '^redis==' ../requirements/coverage.txt)"
34 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'fakeredis==' ../requirements/coverage.txt)"
35 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'typing-extensions==' ../requirements/coverage.txt)"
36 $PYTEST tests/redis/
37 pipscip-shell system . . pip. uninstall -y redis fakeredis
38
39 $PYTEST tests/typing_extensions/
40 if [scip-shell system . . `[`. "$HYPOTHESIS_PROFILE" != "crosshair" ] && [scip-shell system . . `[`. "$(python -c 'import sys; print(sys.version_info[:2] > (3, 10))')" = "True" ]; then
41 pipscip-shell system . . pip. uninstall -y typing-extensions
42 fi
43
44 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'annotated-types==' ../requirements/coverage.txt)"
45 $PYTEST tests/test_annotated_types.py
46 pipscip-shell system . . pip. uninstall -y annotated-types
47
48 pipscip-shell system . . pip. install ".[lark]"
49 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. -m 1 -oE 'lark>=([0-9.]+)' ../hypothesis-python/pyproject.toml | trscip-shell system . . tr. '>' =)"
50 $PYTEST -Wignore tests/lark/
51 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'lark==' ../requirements/coverage.txt)"
52 $PYTEST tests/lark/
53 pipscip-shell system . . pip. uninstall -y lark
54
55 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
56 pipscip-shell system . . pip. install ".[codemods,cli]"
57 $PYTEST tests/codemods/
58
59 if [scip-shell system . . `[`. "$(python -c 'import sys; print(sys.version_info[:2] == (3, 10))')" = "True" ] ; then
60 # Per NEP-29, this is the last version to support Python 3.10
61 pipscip-shell system . . pip. install numpy==2.2.6
62 else
63 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. 'numpy==' ../requirements/coverage.txt)"
64 fi
65
66 pipscip-shell system . . pip. install "$(grepscip-shell system . . grep. -E 'black(==| @)' ../requirements/coverage.txt)"
67 $PYTEST tests/patching/
68 pipscip-shell system . . pip. uninstall -y libcst
69
70 # One of the ghostwriter tests uses attrs (though hypothesis[ghostwriter] does not require attrs).
71 pipscip-shell system . . pip. install attrs
72 $PYTEST tests/ghostwriter/
73 pipscip-shell system . . pip. uninstall -y attrs
74 pipscip-shell system . . pip. uninstall -y black
75
76 if [scip-shell system . . `[`. "$HYPOTHESIS_PROFILE" != "crosshair" ] ; then
77 # Crosshair tracer is not compatible with no-gil
78 if [scip-shell system . . `[`. "$(python -c "import sys; print('free-threading' in sys.version)")" != "True" ] ; then
79 # Run twice, interleaved by other tests, to make it more probable to tickle any problems
80 # from accidentally caching/retaining crosshair proxy objects
81 pipscip-shell system . . pip. install pytest-repeat
82 pipscip-shell system . . pip. install -r ../requirements/crosshair.txt
83 # requirements/crosshair.txt pins hypothesis. Re-override it with our local changes
84 pipscip-shell system . . pip. install .
85 $PYTEST --count=2 --repeat-scope=session tests/numpy tests/crosshair
86 # ...but running twice takes time, don't overdo it
87 $PYTEST tests/array_api
88 else
89 $PYTEST tests/array_api tests/numpy
90 fi
91 fi
92 fi