Skip to main content

hypothesis-crosshair

Downloads

Add the power of solver-based symbolic execution to your Hypothesis tests with CrossHair.

Just

pip install hypothesis-crosshair

and then add a backend="crosshair" setting, like so:

from hypothesis import given, settings, strategies as st

@settings(backend="crosshair")
@given(st.integers())
def test_needs_solver(x):
    assert x != 123456789

Docs hopefully coming soon. In the meantime, start a discussion or file an issue.

FAQ

Can I try using crosshair for ALL my hypothesis tests?

Yes! Create or edit your pytest conftest.py file to register a profile like the following:

from hypothesis import settings

settings.register_profile(
    "crosshair",
    backend="crosshair",
)

And then run pytest using the profile you've defined:

pytest . --hypothesis-profile=crosshair 

Changelog

0.0.14

  • Support the revised hypothesis provider draw interfaces as of hypothesis v6.112.0.

0.0.13

0.0.12

  • Error early when trying to nest hypothesis tests. (which will otherwise put CrossHair into a bad state)

0.0.11

  • Address errors when the solver can't keep up (fixes #20)

0.0.10

  • Reduce the numebr of iterations required to generate valid datetimes

0.0.9

  • Quietly ignore iterations that appear to be failing due to symbolic intolerance.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypothesis_crosshair-0.0.14.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypothesis_crosshair-0.0.14-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file hypothesis_crosshair-0.0.14.tar.gz.

File metadata

  • Download URL: hypothesis_crosshair-0.0.14.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for hypothesis_crosshair-0.0.14.tar.gz
Algorithm Hash digest
SHA256 df5e5e4f69eb61bac391912c1880b5c8eb4126b1717700bd909c36c88b0fe368
MD5 2b6f3317fc58e6d10901219c54473600
BLAKE2b-256 b41f4f7fc53a1f597cbea952c4ddb18017fa38bf0289835609d88dce5233903c

See more details on using hashes here.

File details

Details for the file hypothesis_crosshair-0.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for hypothesis_crosshair-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 bd520d44d60fbf7310a15ade2e3ae771682a942de9b3f7012fdf8af14c218c5b
MD5 27a6e105a9a5faf62623d87bb79e7e3e
BLAKE2b-256 e08737d66f8c2134374469f6d5688c6549d75f743bdb6f12e1d574a11aec2da7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page