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.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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cddfd7ca0fc822f93db2a792ca7b725bac1c9a1f6fd947f5208bbe8da294fe0d |
|
MD5 | 5e45f048cd0e8c73fa961000c6568544 |
|
BLAKE2b-256 | c196e53fd6308bdd0dc6594cd166c3ebf16d07aa834190699857e8094afb2a5b |
Close
Hashes for hypothesis_crosshair-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4cf895d74456105a4d380f372e81238b368ee6348b8a574c563df3768f0195 |
|
MD5 | ce6795704db01e03f4650d92200cc628 |
|
BLAKE2b-256 | dcfb8c52cc779df92470ac3d9f71e0ba6e3312d2221d3f6cdce308c333af0228 |