Skip to content

Commit

Permalink
Enable hypothesis for 23.04 (#5221)
Browse files Browse the repository at this point in the history
Authors:
  - Carl Simon Adorf (https://github.com/csadorf)

Approvers:
  - William Hicks (https://github.com/wphicks)
  - Ray Douglass (https://github.com/raydouglass)

URL: #5221
  • Loading branch information
csadorf authored Feb 17, 2023
1 parent 3bab4d1 commit a738de9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
conda-python-tests-singlegpu:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
env:
RAPIDS_CUML_RUN_HYPOTHESIS=1
with:
build_type: nightly
branch: ${{ inputs.branch }}
Expand Down
19 changes: 19 additions & 0 deletions python/cuml/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
pytest_plugins = "cuml.testing.plugins.quick_run_plugin"

CI = os.environ.get("CI") in ("true", "1")
HYPOTHESIS_ENABLED = os.environ.get("RAPIDS_CUML_RUN_HYPOTHESIS") in (
"true",
"1",
)


# Configure hypothesis profiles
Expand All @@ -54,10 +58,25 @@
]
)


HYPOTHESIS_DEFAULT_PHASES = (
(
hypothesis.Phase.explicit,
hypothesis.Phase.reuse,
hypothesis.Phase.generate,
hypothesis.Phase.target,
hypothesis.Phase.shrink,
)
if HYPOTHESIS_ENABLED
else (hypothesis.Phase.explicit,)
)


hypothesis.settings.register_profile(
name="unit",
deadline=None if CI else timedelta(milliseconds=2000),
parent=hypothesis.settings.get_profile("default"),
phases=HYPOTHESIS_DEFAULT_PHASES,
max_examples=20,
suppress_health_check=HEALTH_CHECKS_SUPPRESSED_BY_DEFAULT,
)
Expand Down
3 changes: 0 additions & 3 deletions python/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ filterwarnings =
error::FutureWarning:cuml[.*] # Catch uses of deprecated positional args in testing
ignore:[^.]*ABCs[^.]*:DeprecationWarning:patsy[.*]
ignore:(.*)alias(.*):DeprecationWarning:hdbscan[.*]

# Do not run any hypothesis tests
addopts = -m 'not hypothesis'

0 comments on commit a738de9

Please sign in to comment.