File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,14 @@ jobs:
368
368
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
369
369
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
370
370
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -U hypothesis
371
+ - name : ' Restore Hypothesis database'
372
+ id : cache-hypothesis-database
373
+ uses : actions/cache@v3
374
+ with :
375
+ path : ./hypothesis
376
+ key : hypothesis-database-${{ github.head_ref || github.run_id }}
377
+ restore-keys : |
378
+ - hypothesis-database-
371
379
- name : " Run tests"
372
380
working-directory : ${{ env.CPYTHON_BUILDDIR }}
373
381
run : |
@@ -388,6 +396,11 @@ jobs:
388
396
-x test_subprocess \
389
397
-x test_signal \
390
398
-x test_sysconfig
399
+ - uses : actions/upload-artifact@v3
400
+ if : always()
401
+ with :
402
+ name : hypothesis-example-db
403
+ path : .hypothesis/examples/
391
404
392
405
393
406
build_asan :
Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
try :
2
4
import hypothesis
3
5
except ImportError :
4
6
from . import _hypothesis_stubs as hypothesis
7
+ else :
8
+ # When using the real Hypothesis, we'll configure it to ignore occasional
9
+ # slow tests (avoiding flakiness from random VM slowness in CI).
10
+ hypothesis .settings .register_profile (
11
+ "slow-is-ok" ,
12
+ deadline = None ,
13
+ suppress_health_check = [hypothesis .HealthCheck .too_slow ],
14
+ )
15
+ hypothesis .settings .load_profile ("slow-is-ok" )
16
+
17
+ # For local development, we'll write to the default on-local-disk database
18
+ # of failing examples, and also use a pull-through cache to automatically
19
+ # replay any failing examples discovered in CI. For details on how this
20
+ # works, see https://hypothesis.readthedocs.io/en/latest/database.html
21
+ if "CI" not in os .environ :
22
+ from hypothesis .database import (
23
+ GitHubArtifactDatabase ,
24
+ MultiplexedDatabase ,
25
+ ReadOnlyDatabase ,
26
+ )
27
+
28
+ hypothesis .settings .register_profile (
29
+ "cpython-local-dev" ,
30
+ database = MultiplexedDatabase (
31
+ hypothesis .settings .default .database ,
32
+ ReadOnlyDatabase (GitHubArtifactDatabase ("python" , "cpython" )),
33
+ ),
34
+ )
35
+ hypothesis .settings .load_profile ("cpython-local-dev" )
You can’t perform that action at this time.
0 commit comments