diff --git a/docs/changes.rst b/docs/changes.rst index 8d83d0825f..70d22f9d44 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -23,9 +23,13 @@ information to the contrary. ------------------ -3.8.4 - 2017-05-12 +3.8.4 - 2017-05-14 ------------------ +This is a compatibility bugfix release. ``sampled_from`` no longer raises +a deprecation warning when sampling from an ``Enum``, as all enums have a +reliable iteration order. + Instead of unconditionally importing ``sqlite3``, Hypothesis now imports it when a SQLite database is first used. This was the major blocker for BSD support with default settings. diff --git a/src/hypothesis/internal/conjecture/utils.py b/src/hypothesis/internal/conjecture/utils.py index d3ac5d8abe..d17fa123ed 100644 --- a/src/hypothesis/internal/conjecture/utils.py +++ b/src/hypothesis/internal/conjecture/utils.py @@ -17,6 +17,7 @@ from __future__ import division, print_function, absolute_import +import enum import math from collections import Sequence @@ -104,7 +105,7 @@ def centered_integer_range(data, lower, upper, center): def check_sample(values): - if not isinstance(values, Sequence): + if not isinstance(values, (Sequence, enum.EnumMeta)): note_deprecation( ('Cannot sample from %r, not a sequence. ' % (values,)) + 'Hypothesis goes to some length to ensure that sampling an '