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

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

Uploaded Source

Built Distribution

hypothesis_crosshair-0.0.12-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypothesis_crosshair-0.0.12.tar.gz
  • Upload date:
  • Size: 7.8 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.12.tar.gz
Algorithm Hash digest
SHA256 5d5f023fe528bf360125697641197052c41187813a01e62faf4f2b822ee8f989
MD5 dd1e7f0d0968a8ac6234f655ec8eaf5b
BLAKE2b-256 72eaa41bd46b7775099ad5a6cbd649cf8280f6038f398dcdc834195e77654756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis_crosshair-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e553bd8ea8081fc145d545ba35e0fd27e6fd840ae631a8c505672c3033f858b8
MD5 ca5e0c5fb611073ea49b58e9e1b734e2
BLAKE2b-256 1808993f5cf9e5eb9261addf06089980cc51bdf88f08b92b5ea9c595c1c5c7ac

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