Skip to content

Commit

Permalink
Add docs and release note
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed May 16, 2018
1 parent ddd7254 commit 30a29b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
RELEASE_TYPE: minor

This release adds a new mechanism to infer strategies for classes
defined using :pypi:`attrs`, based on the the type, converter, or
validator of each attribute. This inference is now built in to
:func:`~hypothesis.strategies.builds` and :func:`~hypothesis.strategies.from_type`.
1 change: 1 addition & 0 deletions hypothesis-python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'pytest': ('https://docs.pytest.org/en/stable/', None),
'django': ('https://django.readthedocs.io/en/stable/', None),
'attrs': ('http://www.attrs.org/en/stable/', None),
}

autodoc_mock_imports = ['pandas']
Expand Down
6 changes: 6 additions & 0 deletions hypothesis-python/src/hypothesis/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,12 @@ def builds(
value :const:`hypothesis.infer` as a keyword argument to
builds, instead of a strategy for that argument to the callable.
If the callable is a class defined with :pypi:`attrs`, missing required
arguments may be inferred from the type, converter, or validator (for
:func:`~attrs:attr.validators.in_`,
:func:`~attrs:attr.validators.optional`, or
:func:`~attrs:attr.validators.instance_of` validators) of the attribute.
Examples from this strategy shrink by shrinking the argument values to
the callable.
"""
Expand Down

0 comments on commit 30a29b9

Please sign in to comment.