Level-up your Hypothesis tests with CrossHair.
Project description
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.14
- Support the revised hypothesis provider draw interfaces as of hypothesis
v6.112.0
.
0.0.13
- Integrate with the hypothesis observability system.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for hypothesis_crosshair-0.0.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5e5e4f69eb61bac391912c1880b5c8eb4126b1717700bd909c36c88b0fe368 |
|
MD5 | 2b6f3317fc58e6d10901219c54473600 |
|
BLAKE2b-256 | b41f4f7fc53a1f597cbea952c4ddb18017fa38bf0289835609d88dce5233903c |
Close
Hashes for hypothesis_crosshair-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd520d44d60fbf7310a15ade2e3ae771682a942de9b3f7012fdf8af14c218c5b |
|
MD5 | 27a6e105a9a5faf62623d87bb79e7e3e |
|
BLAKE2b-256 | e08737d66f8c2134374469f6d5688c6549d75f743bdb6f12e1d574a11aec2da7 |