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.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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab591e4f980469615761a2c92c75bd6fca9f35c85df5201f0c360dead3a95bb6 |
|
MD5 | 362c205b0fae38bca856619a1844da6f |
|
BLAKE2b-256 | 48f6d69bc60fd3ccf7cae3bd27824913d696f88b49818a0d2ee8a5d4be3c5b7f |
Close
Hashes for hypothesis_crosshair-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57da4ccf3e1b7ec3331ec853b176a1913dc02bf9db099f34bc21942837a0624d |
|
MD5 | a71d9bc2d35d46bd0e7b5b4e4ed66ecf |
|
BLAKE2b-256 | 80e68f6734c2da8f0c4e8f18cdc029c08eafbea837887af506e67c29d5f7c165 |