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

Metadata

Release files for hypothesis-crosshair 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hypothesis-crosshair 0.0.12
File Size Uploaded
hypothesis_crosshair-0.0.12.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hypothesis-crosshair 0.0.12
File Interpreter ABI Platform
hypothesis_crosshair-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / hypothesis_crosshair-0.0.12.tar.gz

Download URL hypothesis_crosshair-0.0.12.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d5f023fe528bf360125697641197052c41187813a01e62faf4f2b822ee8f989
BLAKE2b-256 checksum
How to use checksums
72eaa41bd46b7775099ad5a6cbd649cf8280f6038f398dcdc834195e77654756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / hypothesis_crosshair-0.0.12-py3-none-any.whl

Download URL hypothesis_crosshair-0.0.12-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e553bd8ea8081fc145d545ba35e0fd27e6fd840ae631a8c505672c3033f858b8
BLAKE2b-256 checksum
How to use checksums
1808993f5cf9e5eb9261addf06089980cc51bdf88f08b92b5ea9c595c1c5c7ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.13

2 release files

This release

0.0.12 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page