Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hypothesis to 3.34.0 #78

Closed
wants to merge 2 commits into from

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Nov 2, 2017

There's a new version of hypothesis available.
You are currently using 3.30.4. I have updated it to 3.34.0

These links might come in handy: PyPI | Changelog | Repo

Changelog

3.34.0


Hypothesis now emits deprecation warnings if you apply
:func:given <hypothesis.given> more than once to a target.

Applying :func:given <hypothesis.given> repeatedly wraps the target multiple
times. Each wrapper will search the space of of possible parameters separately.
This is equivalent but will be much more inefficient than doing it with a
single call to :func:given <hypothesis.given>.

For example, instead of
given(booleans()) given(integers()), you could write
given(booleans(), integers())


3.33.1


This is a bugfix release:

  • :func:~hypothesis.strategies.builds would try to infer a strategy for
    required positional arguments of the target from type hints, even if they
    had been given to :func:~hypothesis.strategies.builds as positional
    arguments (:issue:946). Now it only infers missing required arguments.
  • An internal introspection function wrongly reported self as a required
    argument for bound methods, which might also have affected
    :func:~hypothesis.strategies.builds. Now it knows better.

3.33.0


This release supports strategy inference for more field types in Django
:func:~hypothesis.extra.django.models - you can now omit an argument for
Date, Time, Duration, Slug, IP Address, and UUID fields. (:issue:642)

Strategy generation for fields with grouped choices now selects choices from
each group, instead of selecting from the group names.


3.32.2


This patch removes the mergedb tool, introduced in Hypothesis 1.7.1
on an experimental basis. It has never actually worked, and the new
:doc:Hypothesis example database <database> is designed to make such a
tool unnecessary.


3.32.1


This patch has two improvements for strategies based on enumerations.

  • :func:~hypothesis.strategies.from_type now handles enumerations correctly,
    delegating to :func:~hypothesis.strategies.sampled_from. Previously it
    noted that Enum.__init__ has no required arguments and therefore delegated
    to :func:~hypothesis.strategies.builds, which would subsequently fail.
  • When sampling from an :class:python:enum.Flag, we also generate combinations
    of members. Eg for Flag('Permissions', 'READ, WRITE, EXECUTE') we can now
    generate, Permissions.READ, Permissions.READ|WRITE, and so on.

3.32.0


This changes the default value of
:attr:use_coverage=True <hypothesis.settings.use_coverage> to True when
running on pypy (it was already True on CPython).

It was previously set to False because we expected it to be too slow, but
recent benchmarking shows that actually performance of the feature on pypy is
fairly acceptable - sometimes it's slower than on CPython, sometimes it's
faster, but it's generally within a factor of two either way.


3.31.6


This patch improves the quality of strategies inferred from Numpy dtypes:

  • Integer dtypes generated examples with the upper half of their (non-sign) bits
    set to zero. The inferred strategies can now produce any representable integer.
  • Fixed-width unicode- and byte-string dtypes now cap the internal example
    length, which should improve example and shrink quality.
  • Numpy arrays can only store fixed-size strings internally, and allow shorter
    strings by right-padding them with null bytes. Inferred string strategies
    no longer generate such values, as they can never be retrieved from an array.
    This improves shrinking performance by skipping useless values.

This has already been useful in Hypothesis - we found an overflow bug in our
Pandas support, and as a result :func:~hypothesis.extra.pandas.indexes and
:func:~hypothesis.extra.pandas.range_indexes now check that min_size
and max_size are at least zero.


3.31.5


This release fixes a performance problem in tests where
:attr:~hypothesis.settings.use_coverage is set to True.

Tests experience a slow-down proportionate to the amount of code they cover.
This is still the case, but the factor is now low enough that it should be
unnoticeable. Previously it was large and became much larger in 3.28.4.


3.31.4


:func:~hypothesis.strategies.from_type failed with a very confusing error
if passed a :func:~python:typing.NewType (:issue:901). These psudeo-types
are now unwrapped correctly, and strategy inference works as expected.


3.31.3


This release makes some small optimisations to our use of coverage that should
reduce constant per-example overhead. This is probably only noticeable on
examples where the test itself is quite fast. On no-op tests that don't test
anything you may see up to a fourfold speed increase (which is still
significantly slower than without coverage). On more realistic tests the speed
up is likely to be less than that.


3.31.2


This release fixes some formatting and small typos/grammar issues in the
documentation, specifically the page docs/settings.rst, and the inline docs
for the various settings.


3.31.1


This release improves the handling of deadlines so that they act better with
the shrinking process. This fixes :issue:892.

This involves two changes:

  1. The deadline is raised during the initial generation and shrinking, and then
    lowered to the set value for final replay. This restricts our attention to
    examples which exceed the deadline by a more significant margin, which
    increases their reliability.
  2. When despite the above a test still becomes flaky because it is
    significantly faster on rerun than it was on its first run, the error
    message is now more explicit about the nature of this problem, and includes
    both the initial test run time and the new test run time.

In addition, this release also clarifies the documentation of the deadline
setting slightly to be more explicit about where it applies.

This work was funded by Smarkets <https://smarkets.com/>_.


3.31.0


This release blocks installation of Hypothesis on Python 3.3, which
:PEP:reached its end of life date on 2017-09-29 <398>.

This should not be of interest to anyone but downstream maintainers -
if you are affected, migrate to a secure version of Python as soon as
possible or at least seek commercial support.


Got merge conflicts? Close this PR and delete the branch. I'll create a new PR for you.

Happy merging! 🤖

@pyup-bot
Copy link
Collaborator Author

pyup-bot commented Nov 2, 2017

Closing this in favor of #79

@pyup-bot pyup-bot closed this Nov 2, 2017
@ericmjl ericmjl deleted the pyup-update-hypothesis-3.30.4-to-3.34.0 branch November 2, 2017 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant