Skip to main content

Level-up your Hypothesis tests with CrossHair.

Project description

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.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.

Project details


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.10.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

hypothesis_crosshair-0.0.10-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypothesis_crosshair-0.0.10.tar.gz
  • Upload date:
  • Size: 7.7 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.10.tar.gz
Algorithm Hash digest
SHA256 10fb06376bbe98da18d8ff8759e4e12b9bab7e18c8bbf17c8c807430fbd860a6
MD5 9b0fc3d13089576ccc374443ee186317
BLAKE2b-256 a892fcaf925a0ee29492b77c9a8584dddd703262c769ea491a84e80b00ac92fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis_crosshair-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a17ab7633bddceb0ed39b82aecf8bc39199dcda0a649459be9055e365ca3b4f4
MD5 a1a0980e964c947455a1a6b2252bd97e
BLAKE2b-256 36bb1911795922f1eed4381c7dd7afba15171d36153f3733b615d3e68e7f7d58

See more details on using hashes here.

Supported by

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