Skip to content

Commit 89525a2

Browse files
committed
🎨 Hook up hypothesis profiles
Problem: - Building hypothesis tests on the command line takes too long. - Building hypothesis tests in CI does not test enough cases. Solution: - Use different profiles: 10 iterations on the command line and 500 in CI. Note: - The default (with no profile) is 100 iterations.
1 parent a598519 commit 89525a2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
DEFAULT_LLVM_VERSION: 18
1717
DEFAULT_GCC_VERSION: 13
1818
MULL_LLVM_VERSION: 17
19+
HYPOTHESIS_PROFILE: ci
1920

2021
concurrency:
2122
group: ${{ github.head_ref || github.run_id }}

test/pbt/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
hypothesis.settings.register_profile("ci", max_examples=500)
1010
hypothesis.settings.register_profile("fast", max_examples=10)
1111

12-
12+
profile = os.environ.get("HYPOTHESIS_PROFILE", "fast")
13+
hypothesis.settings.load_profile(profile)
1314

1415
def pytest_addoption(parser):
1516
parser.addoption("--compiler", action="store", help="C++ compiler", default=None, required=False)

0 commit comments

Comments
 (0)