Skip to content

Commit 36f4c1e

Browse files
committed
conftest.py updates
* Set max examples default to 20 * For faster default runs, over more test quality * Remove unreachable loading default settings path
1 parent 07c8cd0 commit 36f4c1e

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
env:
2929
ARRAY_API_TESTS_MODULE: array_api_strict
3030
run: |
31-
pytest -v -rxXfE --skips-file array-api-strict-skips.txt array_api_tests/
31+
pytest -v -rxXfE --skips-file array-api-strict-skips.txt array_api_tests/ --hypothesis-disable-deadline
3232
# We also have internal tests that isn't really necessary for adopters
3333
pytest -v -rxXfE meta_tests/

conftest.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
from reporting import pytest_metadata, pytest_json_modifyreport, add_extra_json_metadata # noqa
1717

18-
settings.register_profile("xp_default", deadline=800)
1918

2019
def pytest_addoption(parser):
2120
# Hypothesis max examples
@@ -87,21 +86,14 @@ def pytest_configure(config):
8786
"unvectorized: asserts against values via element-wise iteration (not performative!)",
8887
)
8988
# Hypothesis
90-
hypothesis_max_examples = config.getoption("--hypothesis-max-examples")
91-
disable_deadline = config.getoption("--hypothesis-disable-deadline")
92-
derandomize = config.getoption("--hypothesis-derandomize")
93-
profile_settings = {}
94-
if hypothesis_max_examples is not None:
95-
profile_settings["max_examples"] = int(hypothesis_max_examples)
96-
if disable_deadline:
89+
profile_settings = {
90+
"max_examples": config.getoption("--hypothesis-max-examples"),
91+
"derandomize": config.getoption("--hypothesis-derandomize"),
92+
}
93+
if config.getoption("--hypothesis-disable-deadline"):
9794
profile_settings["deadline"] = None
98-
if derandomize:
99-
profile_settings["derandomize"] = True
100-
if profile_settings:
101-
settings.register_profile("xp_override", **profile_settings)
102-
settings.load_profile("xp_override")
103-
else:
104-
settings.load_profile("xp_default")
95+
settings.register_profile("array-api-tests", **profile_settings)
96+
settings.load_profile("array-api-tests")
10597
# CI
10698
if config.getoption("--ci"):
10799
warnings.warn(
@@ -156,7 +148,7 @@ def pytest_collection_modifyitems(config, items):
156148

157149
disabled_exts = config.getoption("--disable-extension")
158150
disabled_dds = config.getoption("--disable-data-dependent-shapes")
159-
unvectorized_max_examples = math.ceil(math.log(int(config.getoption("--hypothesis-max-examples")) or 50))
151+
unvectorized_max_examples = math.ceil(math.log(config.getoption("--hypothesis-max-examples")))
160152

161153
# 2. Iterate through items and apply markers accordingly
162154
# ------------------------------------------------------

0 commit comments

Comments
 (0)