|
15 | 15 |
|
16 | 16 | from reporting import pytest_metadata, pytest_json_modifyreport, add_extra_json_metadata # noqa
|
17 | 17 |
|
18 |
| -settings.register_profile("xp_default", deadline=800) |
19 | 18 |
|
20 | 19 | def pytest_addoption(parser):
|
21 | 20 | # Hypothesis max examples
|
@@ -87,21 +86,14 @@ def pytest_configure(config):
|
87 | 86 | "unvectorized: asserts against values via element-wise iteration (not performative!)",
|
88 | 87 | )
|
89 | 88 | # 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"): |
97 | 94 | 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") |
105 | 97 | # CI
|
106 | 98 | if config.getoption("--ci"):
|
107 | 99 | warnings.warn(
|
@@ -156,7 +148,7 @@ def pytest_collection_modifyitems(config, items):
|
156 | 148 |
|
157 | 149 | disabled_exts = config.getoption("--disable-extension")
|
158 | 150 | 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"))) |
160 | 152 |
|
161 | 153 | # 2. Iterate through items and apply markers accordingly
|
162 | 154 | # ------------------------------------------------------
|
|
0 commit comments