Skip to content

Commit a5ba241

Browse files
committed
test: fix and enable hypothesis profiles
1 parent 037025d commit a5ba241

7 files changed

+44
-36
lines changed

.github/workflows/check-generated-files.yml

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ concurrency:
1919
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
2020
cancel-in-progress: true
2121

22+
env:
23+
FORCE_COLOR: "1"
24+
SQLALCHEMY_WARN_20: "1"
25+
HYPOTHESIS_PROFILE: "ci"
26+
2227
jobs:
2328
check_setuptools_install:
2429
runs-on: ubuntu-latest

.github/workflows/ibis-backends-cloud.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ concurrency:
2323

2424
env:
2525
FORCE_COLOR: "1"
26+
SQLALCHEMY_WARN_20: "1"
27+
HYPOTHESIS_PROFILE: "ci"
2628

2729
jobs:
2830
test_backends:

.github/workflows/ibis-backends.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ env:
3838
FORCE_COLOR: "1"
3939
ODBCSYSINI: "${{ github.workspace }}/ci/odbc"
4040
SQLALCHEMY_WARN_20: "1"
41+
HYPOTHESIS_PROFILE: "ci"
4142

4243
jobs:
4344
test_backends:

.github/workflows/ibis-docs-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
- name: run doctest
161161
# keep HOME because duckdb (which we use for doctests) wants to use
162162
# that for extensions
163-
run: nix develop --ignore-environment --keep HOME -c just doctest
163+
run: nix develop --ignore-environment --keep HOME --keep HYPOTHESIS_PROFILE -c just doctest
164164

165165
- name: generate api docs
166166
run: nix develop --ignore-environment -c just docs-apigen --verbose
@@ -198,7 +198,7 @@ jobs:
198198
- name: run doctests
199199
# keep HOME because duckdb (which we use for doctests) wants to use
200200
# that for extensions
201-
run: nix develop --ignore-environment --keep HOME -c just doctest
201+
run: nix develop --ignore-environment --keep HOME --keep HYPOTHESIS_PROFILE -c just doctest
202202

203203
- name: build api docs
204204
run: nix develop --ignore-environment -c just docs-apigen --verbose

.github/workflows/ibis-main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ concurrency:
3232

3333
env:
3434
FORCE_COLOR: "1"
35+
SQLALCHEMY_WARN_20: "1"
36+
HYPOTHESIS_PROFILE: "ci"
3537

3638
jobs:
3739
test_core:
3840
name: Test ${{ matrix.os }} python-${{ matrix.python-version }}
39-
env:
40-
SQLALCHEMY_WARN_20: "1"
4141
runs-on: ${{ matrix.os }}
4242
strategy:
4343
fail-fast: false

conftest.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from __future__ import annotations
2+
3+
import os
4+
5+
import hypothesis as h
6+
7+
# setup hypothesis profiles
8+
h.settings.register_profile(
9+
"ci",
10+
max_examples=1000,
11+
suppress_health_check=[h.HealthCheck.too_slow],
12+
deadline=None,
13+
)
14+
h.settings.register_profile(
15+
"dev",
16+
max_examples=50,
17+
suppress_health_check=[h.HealthCheck.too_slow],
18+
deadline=None,
19+
)
20+
h.settings.register_profile(
21+
"debug",
22+
max_examples=10,
23+
verbosity=h.Verbosity.verbose,
24+
suppress_health_check=[h.HealthCheck.too_slow],
25+
deadline=None,
26+
)
27+
28+
# load default hypothesis profile, either set HYPOTHESIS_PROFILE environment
29+
# variable or pass --hypothesis-profile option to pytest, to see the generated
30+
# examples try:
31+
# pytest pyarrow -sv --hypothesis-profile=debug
32+
h.settings.load_profile(os.environ.get("HYPOTHESIS_PROFILE", "dev"))

ibis/tests/conftest.py

-32
Original file line numberDiff line numberDiff line change
@@ -1,32 +0,0 @@
1-
from __future__ import annotations
2-
3-
import os
4-
5-
import hypothesis as h
6-
7-
# setup hypothesis profiles
8-
h.settings.register_profile(
9-
"ci",
10-
max_examples=1000,
11-
suppress_health_check=[h.HealthCheck.too_slow],
12-
deadline=None,
13-
)
14-
h.settings.register_profile(
15-
"dev",
16-
max_examples=50,
17-
suppress_health_check=[h.HealthCheck.too_slow],
18-
deadline=None,
19-
)
20-
h.settings.register_profile(
21-
"debug",
22-
max_examples=10,
23-
verbosity=h.Verbosity.verbose,
24-
suppress_health_check=[h.HealthCheck.too_slow],
25-
deadline=None,
26-
)
27-
28-
# load default hypothesis profile, either set HYPOTHESIS_PROFILE environment
29-
# variable or pass --hypothesis-profile option to pytest, to see the generated
30-
# examples try:
31-
# pytest pyarrow -sv --hypothesis-profile=debug
32-
h.settings.load_profile(os.environ.get("HYPOTHESIS_PROFILE", "dev"))

0 commit comments

Comments
 (0)