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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypothesis_crosshair-0.0.11.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.11.tar.gz
Algorithm Hash digest
SHA256 ab591e4f980469615761a2c92c75bd6fca9f35c85df5201f0c360dead3a95bb6
MD5 362c205b0fae38bca856619a1844da6f
BLAKE2b-256 48f6d69bc60fd3ccf7cae3bd27824913d696f88b49818a0d2ee8a5d4be3c5b7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hypothesis_crosshair-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 57da4ccf3e1b7ec3331ec853b176a1913dc02bf9db099f34bc21942837a0624d
MD5 a71d9bc2d35d46bd0e7b5b4e4ed66ecf
BLAKE2b-256 80e68f6734c2da8f0c4e8f18cdc029c08eafbea837887af506e67c29d5f7c165

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