Skip to content

Commit

Permalink
Test CrossHair backend in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse authored and Zac-HD committed Mar 24, 2024
1 parent 9a8422c commit 2fda65f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -73,6 +73,9 @@ jobs:
- check-pandas13
- check-pandas12
- check-pandas11
# - check-crosshair-cover
# - check-crosshair-nocover
# - check-crosshair-niche
- check-py38-oldestnumpy
fail-fast: false
steps:
Expand Down
4 changes: 2 additions & 2 deletions hypothesis-python/tests/common/setup.py
Expand Up @@ -61,7 +61,7 @@ def run():

settings.register_profile("debug", settings(verbosity=Verbosity.debug))

settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default"))

for backend in set(AVAILABLE_PROVIDERS) - {"hypothesis"}:
settings.register_profile(backend, backend=backend) # e.g. "crosshair"

settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default"))
15 changes: 15 additions & 0 deletions hypothesis-python/tox.ini
Expand Up @@ -103,6 +103,21 @@ commands =
python -bb -X dev -m pytest tests/pandas -n auto
# Adding a new pandas? See comment above!

[testenv:crosshair-{cover,nocover,niche,custom}]
deps =
-r../requirements/test.txt
-e .[crosshair]
allowlist_externals =
bash
setenv=
HYPOTHESIS_PROFILE=crosshair
commands =
# invoke with `./build.sh check-crosshair-cover -- -x -Wignore`
cover: python -bb -X dev -m pytest -n auto tests/cover/ tests/pytest/ {posargs}
nocover: python -bb -X dev -m pytest -n auto tests/nocover/ {posargs}
niche: bash scripts/other-tests.sh
custom: python -bb -X dev -m pytest {posargs}

[testenv:django32]
commands =
pip install .[pytz]
Expand Down
7 changes: 5 additions & 2 deletions tooling/src/hypothesistooling/__main__.py
Expand Up @@ -481,9 +481,9 @@ def tox(*args):
run_tox(*args)


def standard_tox_task(name, *args, py=ci_version):
def standard_tox_task(name, py=ci_version):
TASKS["check-" + name] = python_tests(
lambda: run_tox(name, PYTHONS.get(py, py), *args)
lambda *args: run_tox(name, PYTHONS.get(py, py), *args)
)


Expand All @@ -498,6 +498,9 @@ def standard_tox_task(name, *args, py=ci_version):
for n in [11, 12, 13, 14, 15, 20]:
standard_tox_task(f"pandas{n}")

for kind in ("cover", "nocover", "niche"):
standard_tox_task(f"crosshair-{kind}")

standard_tox_task("py38-oldestnumpy", py="3.8")

standard_tox_task("coverage")
Expand Down

0 comments on commit 2fda65f

Please sign in to comment.