hypothesis-crosshair
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)
| File | Size | Uploaded | |
|---|---|---|---|
| hypothesis_crosshair-0.0.12.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|