[Python-modules-commits] [python-hypothesis] 01/03: Import python-hypothesis_3.4.2.orig.tar.gz

Tristan Seligmann mithrandi at moszumanska.debian.org
Sat Aug 27 11:02:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

mithrandi pushed a commit to branch master
in repository python-hypothesis.

commit 0123e782e85b42c091ffbba5985e58a1e37bbc78
Author: Tristan Seligmann <mithrandi at debian.org>
Date:   Sat Jul 16 17:29:46 2016 +0200

    Import python-hypothesis_3.4.2.orig.tar.gz
---
 .coveragerc                                        |   1 -
 CONTRIBUTING.rst                                   |   2 +-
 README.rst                                         |  10 +-
 docs/changes.rst                                   | 105 +++++++++++++--------
 docs/database.rst                                  |  45 ++++-----
 docs/endorsements.rst                              |  12 ++-
 docs/examples.rst                                  |   4 +-
 docs/healthchecks.rst                              |   9 +-
 docs/settings.rst                                  |   5 +-
 docs/usage.rst                                     |   1 +
 .../src/hypothesislegacysupport/version.py         |   2 +-
 src/hypothesis/_settings.py                        |  69 +++++---------
 src/hypothesis/core.py                             |   2 +-
 src/hypothesis/internal/charmap.py                 |  16 ++--
 src/hypothesis/internal/compat.py                  |  16 ++++
 src/hypothesis/searchstrategy/strategies.py        |   2 -
 src/hypothesis/strategies.py                       |   2 +-
 src/hypothesis/utils/size.py                       |  26 -----
 src/hypothesis/version.py                          |   2 +-
 tests/cover/test_charmap.py                        |  25 +++++
 tests/cover/test_phases.py                         |  12 +++
 tests/cover/test_settings.py                       |  71 +++++++++++++-
 tests/cover/{test_sizes.py => test_threading.py}   |  21 +++--
 tests/cover/test_verbosity.py                      |  39 ++++++++
 tests/nocover/test_strategy_state.py               |  15 ++-
 25 files changed, 336 insertions(+), 178 deletions(-)

diff --git a/.coveragerc b/.coveragerc
index 5e67a9f..9c8fe97 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -4,7 +4,6 @@ include =
     **/.tox/*/lib/*/site-packages/hypothesis/*.py
     **/.tox/*/lib/*/site-packages/hypothesis/**/*.py
 omit =
-    **/_settings.py
     **/pytestplugin.py
     **/strategytests.py
     **/internal/debug.py
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 75bb30a..d638a5c 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -64,7 +64,7 @@ The build
 ~~~~~~~~~
 
 The build is orchestrated by a giant Makefile which handles installation of the relevant pythons.
-Actually running the tests is managed by `tox <https://tox.readthedocs.org/en/latest/>`_, but the Makefile
+Actually running the tests is managed by `tox <https://tox.readthedocs.io/en/latest/>`_, but the Makefile
 will call out to the relevant tox environments so you mostly don't have to know anything about that
 unless you want to make changes to the test config. You also mostly don't need to know anything about make
 except to type 'make' followed by the name of the task you want to run.
diff --git a/README.rst b/README.rst
index 2ccc894..de9e76b 100644
--- a/README.rst
+++ b/README.rst
@@ -33,17 +33,17 @@ Links of interest
 The main Hypothesis site is at `hypothesis.works <http://hypothesis.works>`_, and contains a lot
 of good introductory and explanatory material.
 
-Extensive documentation and examples of usage are `available at readthedocs <https://hypothesis.readthedocs.org/en/master/>`_.
+Extensive documentation and examples of usage are `available at readthedocs <https://hypothesis.readthedocs.io/en/master/>`_.
 
 If you want to talk to people about using Hypothesis, `we have both an IRC channel
-and a mailing list <https://hypothesis.readthedocs.org/en/latest/community.html>`_.
+and a mailing list <https://hypothesis.readthedocs.io/en/latest/community.html>`_.
 
 If you want to receive occasional updates about Hypothesis, including useful tips and tricks, there's a
 `TinyLetter mailing list to sign up for them <http://tinyletter.com/DRMacIver/>`_.
 
-If you want to contribute to Hypothesis, `instructions are here <https://github.com/Hypothesis/hypothesis-python/blob/master/CONTRIBUTING.rst>`_.
+If you want to contribute to Hypothesis, `instructions are here <https://github.com/HypothesisWorks/hypothesis-python/blob/master/CONTRIBUTING.rst>`_.
 
 If you want to hear from people who are already using Hypothesis, some of them `have written
-about it <https://hypothesis.readthedocs.org/en/latest/endorsements.html>`_.
+about it <https://hypothesis.readthedocs.io/en/latest/endorsements.html>`_.
 
-If you want to create a downstream package of Hypothesis, please read `these guidelines for packagers <http://hypothesis.readthedocs.org/en/latest/packaging.html>`_
+If you want to create a downstream package of Hypothesis, please read `these guidelines for packagers <https://hypothesis.readthedocs.io/en/latest/packaging.html>`_
diff --git a/docs/changes.rst b/docs/changes.rst
index cb9adfd..205224e 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -21,6 +21,31 @@ Hypothesis APIs come in three flavours:
 You should generally assume that an API is internal unless you have specific
 information to the contrary.
 
+
+------------------
+3.4.2 - 2016-07-13
+------------------
+
+This is a bug fix release, fixing a number of problems with the settings system:
+
+* Test functions defined using @given can now be called from other threads
+  (Issue #337)
+* Attempting to delete a settings property would previously have silently done
+  the wrong thing. Now it raises an AttributeError.
+* Creating a settings object with a custom database_file parameter was silently
+  getting ignored and the default was being used instead. Now it's not.
+
+------------------
+3.4.1 - 2016-07-07
+------------------
+
+This is a bug fix release for a single bug:
+
+* On Windows when running two Hypothesis processes in parallel (e.g. using
+  pytest-xdist) they could race with each other and one would raise an exception
+  due to the non-atomic nature of file renaming on Windows and the fact that you
+  can't rename over an existing file. This is now fixed.
+
 ------------------
 3.4.0 - 2016-05-27
 ------------------
@@ -323,7 +348,7 @@ Bug fixes:
 
 
 -----------------------------------------------------------------------
-`1.18.1 <https://hypothesis.readthedocs.org/en/1.18.0/>`_ - 2015-12-22
+`1.18.1 <https://hypothesis.readthedocs.io/en/1.18.0/>`_ - 2015-12-22
 -----------------------------------------------------------------------
 
 Two behind the scenes changes:
@@ -338,7 +363,7 @@ Two behind the scenes changes:
   instantiate strategies a lot.
 
 -----------------------------------------------------------------------
-`1.18.0 <https://hypothesis.readthedocs.org/en/1.18.0/>`_ - 2015-12-21
+`1.18.0 <https://hypothesis.readthedocs.io/en/1.18.0/>`_ - 2015-12-21
 -----------------------------------------------------------------------
 
 Features:
@@ -375,7 +400,7 @@ Bug fixes:
   an interestingly worse result in any of the standard scenarios tested.
 
 -----------------------------------------------------------------------
-`1.17.1 <https://hypothesis.readthedocs.org/en/1.17.1/>`_ - 2015-12-16
+`1.17.1 <https://hypothesis.readthedocs.io/en/1.17.1/>`_ - 2015-12-16
 -----------------------------------------------------------------------
 
 A small bug fix release, which fixes the fact that the 'note' function could
@@ -383,7 +408,7 @@ not be used on tests which used the @example decorator to provide explicit
 examples.
 
 -----------------------------------------------------------------------
-`1.17.0 <https://hypothesis.readthedocs.org/en/1.17.0/>`_ - 2015-12-15
+`1.17.0 <https://hypothesis.readthedocs.io/en/1.17.0/>`_ - 2015-12-15
 -----------------------------------------------------------------------
 
 This is actually the same release as 1.16.1, but 1.16.1 has been pulled because
@@ -397,7 +422,7 @@ required a minor version bump):
   but would cause e.g. degraded performance or confusing results.
 
 -----------------------------------------------------------------------
-`1.16.1 <https://hypothesis.readthedocs.org/en/1.16.1/>`_ - 2015-12-14
+`1.16.1 <https://hypothesis.readthedocs.io/en/1.16.1/>`_ - 2015-12-14
 -----------------------------------------------------------------------
 
 Note: This release has been removed.
@@ -408,7 +433,7 @@ to be loaded under Python 2, but when building a bdist it was. In particular
 this would break running setup.py test.
 
 -----------------------------------------------------------------------
-`1.16.0 <https://hypothesis.readthedocs.org/en/1.16.0/>`_ - 2015-12-08
+`1.16.0 <https://hypothesis.readthedocs.io/en/1.16.0/>`_ - 2015-12-08
 -----------------------------------------------------------------------
 
 There are no public API changes in this release but it includes a behaviour
@@ -428,7 +453,7 @@ change that I wasn't comfortable putting in a patch release.
   Additionally note() will now work correctly when used with max_shrinks=0.
 
 -----------------------------------------------------------------------
-`1.15.0 <https://hypothesis.readthedocs.org/en/1.15.0/>`_ - 2015-11-24
+`1.15.0 <https://hypothesis.readthedocs.io/en/1.15.0/>`_ - 2015-11-24
 -----------------------------------------------------------------------
 
 A release with two new features.
@@ -440,7 +465,7 @@ A release with two new features.
 
 
 -----------------------------------------------------------------------
-`1.14.0 <https://hypothesis.readthedocs.org/en/1.14.0/>`_ - 2015-11-01
+`1.14.0 <https://hypothesis.readthedocs.io/en/1.14.0/>`_ - 2015-11-01
 -----------------------------------------------------------------------
 
 
@@ -463,7 +488,7 @@ Bugs:
 
 
 -----------------------------------------------------------------------
-`1.13.0 <https://hypothesis.readthedocs.org/en/1.13.0/>`_ - 2015-10-29
+`1.13.0 <https://hypothesis.readthedocs.io/en/1.13.0/>`_ - 2015-10-29
 -----------------------------------------------------------------------
 
 This is quite a small release, but deprecates some public API functions
@@ -482,7 +507,7 @@ and removes some internal API functionality so gets a minor version bump.
 * hypothesis.strategies.randoms was previously missing from \_\_all\_\_.
 
 -----------------------------------------------------------------------
-`1.12.0 <https://hypothesis.readthedocs.org/en/1.12.0/>`_ - 2015-10-18
+`1.12.0 <https://hypothesis.readthedocs.io/en/1.12.0/>`_ - 2015-10-18
 -----------------------------------------------------------------------
 
 * Significantly improved performance of creating strategies using the functions
@@ -510,7 +535,7 @@ and removes some internal API functionality so gets a minor version bump.
 
 
 -----------------------------------------------------------------------
-`1.11.4 <https://hypothesis.readthedocs.org/en/1.11.4/>`_ - 2015-09-27
+`1.11.4 <https://hypothesis.readthedocs.io/en/1.11.4/>`_ - 2015-09-27
 -----------------------------------------------------------------------
 
 * Hide modifications Hypothesis needs to make to sys.path by undoing them
@@ -526,7 +551,7 @@ and removes some internal API functionality so gets a minor version bump.
   they should have been.
 
 -----------------------------------------------------------------------
-`1.11.3 <https://hypothesis.readthedocs.org/en/1.11.3/>`_ - 2015-09-23
+`1.11.3 <https://hypothesis.readthedocs.io/en/1.11.3/>`_ - 2015-09-23
 -----------------------------------------------------------------------
 
 * Better argument validation for datetimes() strategy - previously setting
@@ -536,7 +561,7 @@ and removes some internal API functionality so gets a minor version bump.
   plugin).
 
 -----------------------------------------------------------------------
-`1.11.2 <https://hypothesis.readthedocs.org/en/1.11.2/>`_ - 2015-09-23
+`1.11.2 <https://hypothesis.readthedocs.io/en/1.11.2/>`_ - 2015-09-23
 -----------------------------------------------------------------------
 
 Bug fixes:
@@ -562,7 +587,7 @@ Misc:
   in the main implementation).
 
 -----------------------------------------------------------------------
-`1.11.1 <https://hypothesis.readthedocs.org/en/1.11.1/>`_ - 2015-09-16
+`1.11.1 <https://hypothesis.readthedocs.io/en/1.11.1/>`_ - 2015-09-16
 -----------------------------------------------------------------------
 
 Bug fixes:
@@ -576,7 +601,7 @@ Bug fixes:
   inspect.getargspec
 
 -----------------------------------------------------------------------
-`1.11.0 <https://hypothesis.readthedocs.org/en/1.11.0/>`_ - 2015-08-31
+`1.11.0 <https://hypothesis.readthedocs.io/en/1.11.0/>`_ - 2015-08-31
 -----------------------------------------------------------------------
 
 * text() with a non-string alphabet would have used the repr() of the the alphabet
@@ -590,13 +615,13 @@ Bug fixes:
   previously have used flatmap for.
 
 -----------------------------------------------------------------------
-`1.10.6 <https://hypothesis.readthedocs.org/en/1.10.6/>`_ - 2015-08-26
+`1.10.6 <https://hypothesis.readthedocs.io/en/1.10.6/>`_ - 2015-08-26
 -----------------------------------------------------------------------
 
 Fix support for fixtures on Django 1.7.
 
 -----------------------------------------------------------------------
-`1.10.4 <https://hypothesis.readthedocs.org/en/1.10.4/>`_ - 2015-08-21
+`1.10.4 <https://hypothesis.readthedocs.io/en/1.10.4/>`_ - 2015-08-21
 -----------------------------------------------------------------------
 
 Tiny bug fix release:
@@ -606,7 +631,7 @@ Tiny bug fix release:
   None.
 
 -----------------------------------------------------------------------
-`1.10.3 <https://hypothesis.readthedocs.org/en/1.10.3/>`_ - 2015-08-19
+`1.10.3 <https://hypothesis.readthedocs.io/en/1.10.3/>`_ - 2015-08-19
 -----------------------------------------------------------------------
 
 Another small bug fix release.
@@ -623,7 +648,7 @@ Another small bug fix release.
 
 
 -----------------------------------------------------------------------
-`1.10.2 <https://hypothesis.readthedocs.org/en/1.10.2/>`_ - 2015-08-19
+`1.10.2 <https://hypothesis.readthedocs.io/en/1.10.2/>`_ - 2015-08-19
 -----------------------------------------------------------------------
 
 This is a small bug fix release:
@@ -634,7 +659,7 @@ This is a small bug fix release:
   erroneously labelling some examples as being duplicates.
 
 -----------------------------------------------------------------------
-`1.10.0 <https://hypothesis.readthedocs.org/en/1.10.0/>`_ - 2015-08-04
+`1.10.0 <https://hypothesis.readthedocs.io/en/1.10.0/>`_ - 2015-08-04
 -----------------------------------------------------------------------
 
 This is just a bugfix and performance release, but it changes some
@@ -664,7 +689,7 @@ semi-public APIs, hence the minor version bump.
   to it as positional.
 
 ---------------------------------------------------------------------
-`1.9.0 <https://hypothesis.readthedocs.org/en/1.9.0/>`_ - 2015-07-27
+`1.9.0 <https://hypothesis.readthedocs.io/en/1.9.0/>`_ - 2015-07-27
 ---------------------------------------------------------------------
 
 Codename: The great bundling.
@@ -687,7 +712,7 @@ the actual data you'll get. There used to be some logic in there to make
 the examples artificially simple but this proved to be a bad idea.
 
 ---------------------------------------------------------------------
-`1.8.5 <https://hypothesis.readthedocs.org/en/1.8.5/>`_ - 2015-07-24
+`1.8.5 <https://hypothesis.readthedocs.io/en/1.8.5/>`_ - 2015-07-24
 ---------------------------------------------------------------------
 
 This contains no functionality changes but fixes a mistake made with
@@ -695,7 +720,7 @@ building the previous package that would have broken installation on
 Windows.
 
 ---------------------------------------------------------------------
-`1.8.4 <https://hypothesis.readthedocs.org/en/1.8.4/>`_ - 2015-07-20
+`1.8.4 <https://hypothesis.readthedocs.io/en/1.8.4/>`_ - 2015-07-20
 ---------------------------------------------------------------------
 
 Bugs fixed:
@@ -708,14 +733,14 @@ Bugs fixed:
 
 
 ---------------------------------------------------------------------
-`1.8.3 <https://hypothesis.readthedocs.org/en/1.8.3/>`_ - 2015-07-20
+`1.8.3 <https://hypothesis.readthedocs.io/en/1.8.3/>`_ - 2015-07-20
 ---------------------------------------------------------------------
 
 "Falsifying example" would not have been printed when the failure came from an
 explicit example.
 
 ---------------------------------------------------------------------
-`1.8.2 <https://hypothesis.readthedocs.org/en/1.8.2/>`_ - 2015-07-18
+`1.8.2 <https://hypothesis.readthedocs.io/en/1.8.2/>`_ - 2015-07-18
 ---------------------------------------------------------------------
 
 Another small bugfix release:
@@ -727,7 +752,7 @@ Another small bugfix release:
   whitespace in the alphabet.
 
 ---------------------------------------------------------------------
-`1.8.1 <https://hypothesis.readthedocs.org/en/1.8.1/>`_ - 2015-07-17
+`1.8.1 <https://hypothesis.readthedocs.io/en/1.8.1/>`_ - 2015-07-17
 ---------------------------------------------------------------------
 
 This is a small release that contains a workaround for people who have
@@ -737,7 +762,7 @@ to work, but Hypothesis leans more heavily on repr than is typical so it's
 worth having a workaround for.
 
 ---------------------------------------------------------------------
-`1.8.0 <https://hypothesis.readthedocs.org/en/1.8.0/>`_ - 2015-07-16
+`1.8.0 <https://hypothesis.readthedocs.io/en/1.8.0/>`_ - 2015-07-16
 ---------------------------------------------------------------------
 
 New features:
@@ -765,7 +790,7 @@ Bug fixes:
 
 
 ---------------------------------------------------------------------
-`1.7.2 <https://hypothesis.readthedocs.org/en/1.7.2/>`_ - 2015-07-10
+`1.7.2 <https://hypothesis.readthedocs.io/en/1.7.2/>`_ - 2015-07-10
 ---------------------------------------------------------------------
 
 This is purely a bug fix release:
@@ -787,7 +812,7 @@ This is purely a bug fix release:
   I'm aware of.
 
 ---------------------------------------------------------------------
-`1.7.1 <https://hypothesis.readthedocs.org/en/1.7.1/>`_ - 2015-06-29
+`1.7.1 <https://hypothesis.readthedocs.io/en/1.7.1/>`_ - 2015-06-29
 ---------------------------------------------------------------------
 
 Codename: There is no 1.7.0.
@@ -819,7 +844,7 @@ Bug fixes:
 
 
 ---------------------------------------------------------------------
-`1.6.2 <https://hypothesis.readthedocs.org/en/1.6.2/>`_ - 2015-06-08
+`1.6.2 <https://hypothesis.readthedocs.io/en/1.6.2/>`_ - 2015-06-08
 ---------------------------------------------------------------------
 
 This is just a few small bug fixes:
@@ -834,7 +859,7 @@ This is just a few small bug fixes:
   this will no longer cause an error when Hypothesis runs out of values.
 
 ---------------------------------------------------------------------
-`1.6.1 <https://hypothesis.readthedocs.org/en/1.6.1/>`_ - 2015-05-21
+`1.6.1 <https://hypothesis.readthedocs.io/en/1.6.1/>`_ - 2015-05-21
 ---------------------------------------------------------------------
 
 This is a small patch release that fixes a bug where 1.6.0 broke the use
@@ -842,7 +867,7 @@ of flatmap with the deprecated API and assumed the passed in function returned
 a SearchStrategy instance rather than converting it to a strategy.
 
 ---------------------------------------------------------------------
-`1.6.0 <https://hypothesis.readthedocs.org/en/v1.6.0/>`_ - 2015-05-21
+`1.6.0 <https://hypothesis.readthedocs.io/en/v1.6.0/>`_ - 2015-05-21
 ---------------------------------------------------------------------
 
 
@@ -874,7 +899,7 @@ some weird behaviours.
 
 
 ---------------------------------------------------------------------
-`1.5.0 <https://hypothesis.readthedocs.org/en/v1.5.0/>`_ - 2015-05-14
+`1.5.0 <https://hypothesis.readthedocs.io/en/v1.5.0/>`_ - 2015-05-14
 ---------------------------------------------------------------------
 
 
@@ -915,7 +940,7 @@ Other changes:
     TestCase infrastructure.
 
 ---------------------------------------------------------------------
-`1.4.0 <https://hypothesis.readthedocs.org/en/v1.4.0/>`_ - 2015-05-04
+`1.4.0 <https://hypothesis.readthedocs.io/en/v1.4.0/>`_ - 2015-05-04
 ---------------------------------------------------------------------
 
 Codename: What a state.
@@ -997,7 +1022,7 @@ Some minor quality improvements:
   now have slightly better simplification.
 
 ---------------------------------------------------------------------
-`1.3.0 <https://hypothesis.readthedocs.org/en/v1.3.0/>`_ - 2015-05-22
+`1.3.0 <https://hypothesis.readthedocs.io/en/v1.3.0/>`_ - 2015-05-22
 ---------------------------------------------------------------------
 
 New features:
@@ -1027,7 +1052,7 @@ General improvements:
 
 
 ---------------------------------------------------------------------
-`1.2.1 <https://hypothesis.readthedocs.org/en/v1.2.1/>`_ - 2015-04-16
+`1.2.1 <https://hypothesis.readthedocs.io/en/v1.2.1/>`_ - 2015-04-16
 ---------------------------------------------------------------------
 
 A small patch release for a bug in the new executors feature. Tests which require
@@ -1035,7 +1060,7 @@ doing something to their result in order to fail would have instead reported as
 flaky.
 
 ---------------------------------------------------------------------
-`1.2.0 <https://hypothesis.readthedocs.org/en/v1.2.0/>`_ - 2015-04-15
+`1.2.0 <https://hypothesis.readthedocs.io/en/v1.2.0/>`_ - 2015-04-15
 ---------------------------------------------------------------------
 
 Codename: Finders keepers.
@@ -1068,7 +1093,7 @@ A bunch of new features and improvements.
   the range.
 
 ---------------------------------------------------------------------
-`1.1.1 <https://hypothesis.readthedocs.org/en/v1.1.1/>`_ - 2015-04-07
+`1.1.1 <https://hypothesis.readthedocs.io/en/v1.1.1/>`_ - 2015-04-07
 ---------------------------------------------------------------------
 
 Codename: Nothing to see here
@@ -1084,7 +1109,7 @@ I'd happened to have finished in time.
 
 
 ---------------------------------------------------------------------
-`1.1.0 <https://hypothesis.readthedocs.org/en/v1.1.0/>`_ - 2015-04-06
+`1.1.0 <https://hypothesis.readthedocs.io/en/v1.1.0/>`_ - 2015-04-06
 ---------------------------------------------------------------------
 
 Codename: No-one mention the M word.
@@ -1109,7 +1134,7 @@ Codename: No-one mention the M word.
 
 
 ---------------------------------------------------------------------
-`1.0.0 <https://hypothesis.readthedocs.org/en/v1.0.0/>`_ - 2015-03-27
+`1.0.0 <https://hypothesis.readthedocs.io/en/v1.0.0/>`_ - 2015-03-27
 ---------------------------------------------------------------------
 
 Codename: Blast-off!
diff --git a/docs/database.rst b/docs/database.rst
index 333008f..5dfe536 100644
--- a/docs/database.rst
+++ b/docs/database.rst
@@ -21,15 +21,17 @@ workflow considerably by making sure that the examples you've just found are rep
 File locations
 --------------
 
-The default (and currently only) storage format is as rather weirdly unidiomatic JSON saved
-in an sqlite3 database. The standard location for that is .hypothesis/examples.db in your current
-working directory. You can override this, either by setting either the database\_file property on
+The default storage format is as a fairly opaque directory structure. Each test
+corresponds to a directory, and each example to a file within that directory.
+The standard location for it is .hypothesis/examples in your current working
+directory. You can override this, either by setting either the database\_file property on
 a settings object (you probably want to specify it on settings.default) or by setting the
 HYPOTHESIS\_DATABASE\_FILE environment variable.
 
-Note: There are other files in .hypothesis but everything other than the examples.db will be
-transparently created on demand. You don't need to and probably shouldn't check those into git.
-Adding .hypothesis/eval_source to your .gitignore or equivalent is probably a good idea.
+There is also a legacy sqlite3 based format. This is mostly still supported for
+compatibility reasons, and support will be dropped in some future version of
+Hypothesis. If you use a database file name ending in .db, .sqlite or .sqlite3
+that format will be used instead.
 
 --------------------------------------------
 Upgrading Hypothesis and changing your tests
@@ -44,28 +46,15 @@ that generates an argument sometimes gives you data from the old strategy.
 Sharing your example database
 -----------------------------
 
-It may be convenient to share an example database between multiple machines - e.g. having a CI
-server continually running to look for bugs, then sharing any changes it makes.
-
 The only currently supported workflow for this (though it would be easy enough to add new ones)
-is via checking the examples.db file into git. Hypothesis provides a git merge script, executable
-as python -m hypothesis.tools.mergedbs.
-
-For example, in order to make this work with the standard location:
-
-In .gitattributes add:
-
-.. code::
+is via checking the examples directory into version control.
 
-  .hypothesis/examples.db merge=hypothesisdb
+The directory structure is designed so that it is entirely suitable for checking
+in to git, mercurial, or any similar version control system. It will be updated
+reasonably often, so you might not want to do that in the course of normal
+development, but it will correctly handle merges, deletes, etc without a
+problem if you just add the directory into version control.
 
-And in .git/config add:
-
-.. code::
-
-  [merge "hypothesisdb"]
-      name = Hypothesis database files
-      driver = python -m hypothesis.tools.mergedbs %O %A %B
-
-This will cause the Hypothesis merge script to be used when both sides of a merge have changed
-the example database.
+Note: There are other files in .hypothesis but everything other than the examples will be
+transparently created on demand. You don't need to and probably shouldn't check those into git.
+Adding .hypothesis/eval_source to your .gitignore or equivalent is probably a good idea.
diff --git a/docs/endorsements.rst b/docs/endorsements.rst
index 0989d94..3f7e7b9 100644
--- a/docs/endorsements.rst
+++ b/docs/endorsements.rst
@@ -111,13 +111,21 @@ to the thoroughness and power of Hypothesis.
 `Jon Moore <https://github.com/jonmoore>`_
 ------------------------------------------
 
-One extremely satisfied user here. Hypothesis is a really solid implementation 
+One extremely satisfied user here. Hypothesis is a really solid implementation
 of property-based testing, adapted well to Python, and with good features
-such as failure-case shrinkers. I first used it on a project where we needed 
+such as failure-case shrinkers. I first used it on a project where we needed
 to verify that a vendor's Python and non-Python implementations of an algorithm
 matched, and it found about a dozen cases that previous example-based testing
 and code inspections had not. Since then I've been evangelizing for it at our firm.
 
+--------------------------------------------
+`Russel Winder <https://www.russel.org.uk>`_
+--------------------------------------------
+
+I am using Hypothesis as an integral part of my Python workshops. Testing is an integral part of Python
+programming and whilst unittest and, better, py.test can handle example-based testing, property-based
+testing is increasingly far more important than example-base testing, and Hypothesis fits the bill.
+
 -------------------------------------------
 `Your name goes here <http://example.com>`_
 -------------------------------------------
diff --git a/docs/examples.rst b/docs/examples.rst
index a3e582a..1d3164c 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -113,7 +113,7 @@ We can now write a test:
 
   from hypothesis import given
 
-  @given(s.lists(Node))
+  @given(s.lists(NodeStrategy))
   def test_sorting_nodes_is_prefix_sorted(xs):
       sort_nodes(xs)
       assert is_prefix_sorted(xs)
@@ -481,4 +481,4 @@ then use the result and go on to do other things are definitely also possible.
         unittest.main()
 
 .. _py.test: http://pytest.org/
-.. _nose: https://nose.readthedocs.org/
+.. _nose: https://nose.readthedocs.io/
diff --git a/docs/healthchecks.rst b/docs/healthchecks.rst
index e9c3cba..3f72bd9 100644
--- a/docs/healthchecks.rst
+++ b/docs/healthchecks.rst
@@ -17,6 +17,9 @@ If any of these scenarios are detected, Hypothesis will emit a warning about the
 The general goal of these health checks is to warn you about things that you are doing that might
 appear to work but will either cause Hypothesis to not work correctly or to perform badly.
 
-These health checks are affected by the perform_health_check settings. If the
-perform_health_check setting is set to False, these health checks will be skipped entirely. This is
-not recommended.
+To selectively disable health checks, use the suppress_health_check settings.
+The argument for this parameter is a list with elements drawn from any of
+the class-level attributes of the HealthCheck class.
+
+To disable all health checks, set the perform_health_check settings parameter
+to False.
diff --git a/docs/settings.rst b/docs/settings.rst
index 7245c31..d2a808d 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -43,7 +43,7 @@ Available settings
 .. autoclass:: settings
     :members: max_examples, max_iterations, min_satisfying_examples,
         max_shrinks, timeout, strict, database_file, stateful_step_count, 
-        database, perform_health_check
+        database, perform_health_check, suppress_health_check
 
 .. _verbose-output:
 
@@ -72,7 +72,8 @@ of verbose output are, well, verbose, but they should convey the idea).
     [True]
     >>> from hypothesis import given
     >>> from hypothesis.strategies import integers
-    >>> @given(integers(), settings=settings(verbosity=Verbosity.verbose))
+    >>> @given(integers())
+    ... @settings(verbosity=Verbosity.verbose)
     ... def test_foo(x):
     ...     assert x > 0
     ...
diff --git a/docs/usage.rst b/docs/usage.rst
index fdf630e..ce9cebf 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -38,4 +38,5 @@ then it should be available on pypi.
 * `tchannel <https://github.com/uber/tchannel-python>`_
 * `vdirsyncer <https://github.com/untitaker/vdirsyncer>`_
 * `wcag-contrast-ratio <https://github.com/gsnedders/wcag-contrast-ratio>`_
+* `yacluster <https://github.com/KrzysiekJ/yacluster>`_
 * `yturl <https://github.com/cdown/yturl>`_
diff --git a/hypothesislegacysupport/src/hypothesislegacysupport/version.py b/hypothesislegacysupport/src/hypothesislegacysupport/version.py
index 9a5c67e..1cd7916 100644
--- a/hypothesislegacysupport/src/hypothesislegacysupport/version.py
+++ b/hypothesislegacysupport/src/hypothesislegacysupport/version.py
@@ -20,5 +20,5 @@
 
 from __future__ import division, print_function, absolute_import
 
-__version_info__ = (3, 4, 0)
+__version_info__ = (3, 4, 2)
 __version__ = '.'.join(map(str, __version_info__))
diff --git a/src/hypothesis/_settings.py b/src/hypothesis/_settings.py
index 68af72a..ddc8f3d 100644
--- a/src/hypothesis/_settings.py
+++ b/src/hypothesis/_settings.py
@@ -65,10 +65,7 @@ class settingsProperty(object):
         obj.__dict__[self.name] = value
 
     def __delete__(self, obj):
-        try:
-            del obj.__dict__[self.name]
-        except KeyError:
-            raise AttributeError(self.name)
+        raise AttributeError('Cannot delete attribute %s' % (self.name,))
 
     @property
     def __doc__(self):
@@ -91,17 +88,13 @@ class settingsMeta(type):
         if v is not None:
             return v
         if hasattr(settings, '_current_profile'):
-            default_variable.value = settings.load_profile(
-                settings._current_profile
-            )
+            settings.load_profile(settings._current_profile)
             assert default_variable.value is not None
         return default_variable.value
 
     @default.setter
     def default(self, value):
-        if default_variable.value is not None:
-            raise AttributeError('Cannot assign settings.default')
-        self._assign_default_internal(value)
+        raise AttributeError('Cannot assign settings.default')
 
     def _assign_default_internal(self, value):
         default_variable.value = value
@@ -140,7 +133,7 @@ class settings(settingsMeta('settings', (object,), {})):
     ):
         self._construction_complete = False
         self._database = kwargs.pop('database', not_set)
-        explicit_kwargs = list(kwargs)
+        database_file = kwargs.get('database_file', not_set)
         defaults = parent or settings.default
         if defaults is not None:
             for setting in all_settings.values():
@@ -149,7 +142,7 @@ class settings(settingsMeta('settings', (object,), {})):
                 elif setting.validator:
                     kwargs[setting.name] = setting.validator(
                         kwargs[setting.name])
-            if self._database is not_set:
+            if self._database is not_set and database_file is not_set:
                 self._database = defaults.database
         for name, value in kwargs.items():
             if name not in all_settings:
@@ -158,10 +151,6 @@ class settings(settingsMeta('settings', (object,), {})):
             setattr(self, name, value)
         self.storage = threading.local()
         self._construction_complete = True
-        for k in explicit_kwargs:
-            deprecation = all_settings[k].deprecation
-            if deprecation:
-                note_deprecation(deprecation, self)
 
     def defaults_stack(self):
         try:
@@ -196,15 +185,10 @@ class settings(settingsMeta('settings', (object,), {})):
             )
         if options is not None:
             options = tuple(options)
-            if default not in options:
-                raise InvalidArgument(
-                    'Default value %r is not in options %r' % (
-                        default, options
-                    )
-                )
+            assert default in options
 
         all_settings[name] = Setting(
-            name, description.strip(), default, options, deprecation, validator
+            name, description.strip(), default, options, validator
         )
         setattr(settings, name, settingsProperty(name))
 
@@ -216,13 +200,11 @@ class settings(settingsMeta('settings', (object,), {})):
         if name in settings._WHITELISTED_REAL_PROPERTIES:
             return object.__setattr__(self, name, value)
         elif name == 'database':
-            if self._construction_complete:
-                raise AttributeError(
-                    'settings objects are immutable and may not be assigned to'
-                    ' after construction.'
-                )
-            else:
-                return object.__setattr__(self, '_database', value)
+            assert self._construction_complete
+            raise AttributeError(
+                'settings objects are immutable and may not be assigned to'
+                ' after construction.'
+            )
         elif name in all_settings:
             if self._construction_complete:
                 raise AttributeError(
@@ -264,20 +246,15 @@ class settings(settingsMeta('settings', (object,), {})):
         this property is accessed on a particular thread.
 
         """
-        try:
-            if self._database is not_set and self.database_file is not None:
-                from hypothesis.database import ExampleDatabase
-                if self.database_file not in _db_cache:
-                    _db_cache[self.database_file] = (
-                        ExampleDatabase(self.database_file))
-                return _db_cache[self.database_file]
-            if self._database is not_set:
-                self._database = None
-            return self._database
-        except AttributeError:
-            import traceback
-            traceback.print_exc()
-            assert False
+        if self._database is not_set and self.database_file is not None:
+            from hypothesis.database import ExampleDatabase
+            if self.database_file not in _db_cache:
+                _db_cache[self.database_file] = (
+                    ExampleDatabase(self.database_file))
+            return _db_cache[self.database_file]
+        if self._database is not_set:
+            self._database = None
+        return self._database
 
     def __enter__(self):
         default_context_manager = default_variable.with_value(self)
@@ -334,7 +311,7 @@ class settings(settingsMeta('settings', (object,), {})):
 
 Setting = namedtuple(
     'Setting', (
-        'name', 'description', 'default', 'options', 'deprecation', 'validator'
+        'name', 'description', 'default', 'options', 'validator'
     ))
 
 
@@ -521,7 +498,7 @@ Verbosity.all = [
 
 ENVIRONMENT_VERBOSITY_OVERRIDE = os.getenv('HYPOTHESIS_VERBOSITY_LEVEL')
 
-if ENVIRONMENT_VERBOSITY_OVERRIDE:
+if ENVIRONMENT_VERBOSITY_OVERRIDE:  # pragma: no cover
     DEFAULT_VERBOSITY = Verbosity.by_name(ENVIRONMENT_VERBOSITY_OVERRIDE)
 else:
     DEFAULT_VERBOSITY = Verbosity.normal
diff --git a/src/hypothesis/core.py b/src/hypothesis/core.py
index 1f889d8..75d7028 100644
--- a/src/hypothesis/core.py
+++ b/src/hypothesis/core.py
@@ -293,7 +293,7 @@ def given(*generator_arguments, **generator_kwargs):
                 if label in settings.suppress_health_check:
                     return
                 message += (
-                    '\nSee http://hypothesis.readthedocs.org/en/latest/health'
+                    '\nSee https://hypothesis.readthedocs.io/en/latest/health'
                     'checks.html for more information about this. '
                 )
                 message += (
diff --git a/src/hypothesis/internal/charmap.py b/src/hypothesis/internal/charmap.py
index 52b01f3..0f2e9eb 100644
--- a/src/hypothesis/internal/charmap.py
+++ b/src/hypothesis/internal/charmap.py
@@ -24,7 +24,7 @@ import tempfile
 import unicodedata
 
 from hypothesis.configuration import tmpdir, storage_directory
-from hypothesis.internal.compat import hunichr, GzipFile
+from hypothesis.internal.compat import hunichr, GzipFile, FileExistsError
 
 
 def charmap_file():
@@ -41,10 +41,10 @@ def charmap():
     if _charmap is None:
         f = charmap_file()
         if not os.path.exists(f):
-            _charmap = {}
+            tmp_charmap = {}
             for i in range(0, sys.maxunicode + 1):
                 cat = unicodedata.category(hunichr(i))
-                rs = _charmap.setdefault(cat, [])
+                rs = tmp_charmap.setdefault(cat, [])
                 if rs and rs[-1][-1] == i - 1:
                     rs[-1][-1] += 1
                 else:
@@ -53,15 +53,19 @@ def charmap():
             # a stable format for our charmap.
             data = sorted(
                 (k, tuple((map(tuple, v))))
-                for k, v in _charmap.items())
+                for k, v in tmp_charmap.items())
 
             # Write the Unicode table atomically
             fd, tmpfile = tempfile.mkstemp(dir=tmpdir())
             os.close(fd)
             with GzipFile(tmpfile, 'wb', mtime=1) as o:
                 o.write(pickle.dumps(data, pickle.HIGHEST_PROTOCOL))
-            os.rename(tmpfile, f)
-
+            try:
+                os.rename(tmpfile, f)
+            except FileExistsError:  # pragma: no cover
+                # This exception is only raised on Windows, and coverage is
+                # measured on Linux.
+                pass
         with GzipFile(f, 'rb') as i:
             _charmap = dict(pickle.loads(i.read()))
     assert _charmap is not None
diff --git a/src/hypothesis/internal/compat.py b/src/hypothesis/internal/compat.py
index 00b5aa5..b680e86 100644
--- a/src/hypothesis/internal/compat.py
+++ b/src/hypothesis/internal/compat.py
@@ -481,3 +481,19 @@ def cast_unicode(s, encoding=None):
 
 def get_stream_enc(stream, default=None):
     return getattr(stream, 'encoding', None) or default
+
+
+# We need to know what sort of exception gets thrown when you try to write over
+# an existing file where you're not allowed to. This is rather less consistent
+# between versions than might be hoped.
+if PY3:
+    # Note: This only works on >= 3.3, but we only support >= 3.3 so that's
+    # fine
+    FileExistsError = FileExistsError
+elif WINDOWS:
+    FileExistsError = WindowsError
+else:
+    # This doesn't happen in this case: We're not on windows and don't support
+    # the x flag because it's Python 2, so there are no places where this can
+    # be thrown.
+    FileExistsError = None
diff --git a/src/hypothesis/searchstrategy/strategies.py b/src/hypothesis/searchstrategy/strategies.py
index db9b875..a2f446a 100644
--- a/src/hypothesis/searchstrategy/strategies.py
+++ b/src/hypothesis/searchstrategy/strategies.py
@@ -73,8 +73,6 @@ class SearchStrategy(object):
     hashable probably won't be.
 
     This may all seem overly complicated but it's for a fairly good reason.
-    For more discussion of the motivation see
-    http://hypothesis.readthedocs.org/en/master/internals.html
 
     Given these, data generation happens in three phases:
 
diff --git a/src/hypothesis/strategies.py b/src/hypothesis/strategies.py
index 1acf481..bdb0bff 100644
--- a/src/hypothesis/strategies.py
+++ b/src/hypothesis/strategies.py
@@ -388,7 +388,7 @@ def sampled_from(elements):
     elements.
 
     Note that as with just, values will not be copied and thus you
-    should be careful of using mutable data
+    should be careful of using mutable data.
 
     """
 
diff --git a/src/hypothesis/utils/size.py b/src/hypothesis/utils/size.py
deleted file mode 100644
index 75a8da2..0000000
--- a/src/hypothesis/utils/size.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# coding=utf-8
-#
-# This file is part of Hypothesis, which may be found at
-# https://github.com/HypothesisWorks/hypothesis-python
-#
-# Most of this work is copyright (C) 2013-2015 David R. MacIver
-# (david at drmaciver.com), but it contains contributions by others. See
-# CONTRIBUTING.rst for a full list of people who may hold copyright, and
-# consult the git log if you need to determine who owns an individual
-# contribution.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public License,
-# v. 2.0. If a copy of the MPL was not distributed with this file, You can
-# obtain one at http://mozilla.org/MPL/2.0/.
-#
-# END HEADER
-
-from __future__ import division, print_function, absolute_import
-
-
-def clamp(lower, value, upper):
-    if lower is not None:
-        value = max(lower, value)
-    if upper is not None:
-        value = min(value, upper)
-    return value
diff --git a/src/hypothesis/version.py b/src/hypothesis/version.py
index 1b68ae6..5f0f23e 100644
--- a/src/hypothesis/version.py
+++ b/src/hypothesis/version.py
@@ -17,5 +17,5 @@
 
 from __future__ import division, print_function, absolute_import
 
-__version_info__ = (3, 4, 0)
+__version_info__ = (3, 4, 2)
 __version__ = '.'.join(map(str, __version_info__))
diff --git a/tests/cover/test_charmap.py b/tests/cover/test_charmap.py
index 1000b2d..58ee11e 100644
--- a/tests/cover/test_charmap.py
+++ b/tests/cover/test_charmap.py
@@ -21,6 +21,8 @@ import os
 import sys
 import unicodedata
 
+import pytest
+
 import hypothesis.strategies as st
 import hypothesis.internal.charmap as cm
 from hypothesis import given, assume
@@ -118,3 +120,26 @@ def test_successive_union():
     for v in cm.charmap().values():
         x = cm._union_interval_lists(x, v)
     assert x == ((0, sys.maxunicode),)
+
+
+def test_can_handle_race_between_exist_and_create(monkeypatch):
+    x = cm.charmap()
+    cm._charmap = None
+    monkeypatch.setattr(os.path, 'exists', lambda p: False)
+    y = cm.charmap()
+    assert x is not y
+    assert x == y
+
+
+def test_exception_in_write_does_not_lead_to_broken_charmap(monkeypatch):
+    def broken(*args, **kwargs):
+        raise ValueError()
+
+    cm._charmap = None
+    monkeypatch.setattr(os.path, 'exists', lambda p: False)
+    monkeypatch.setattr(os, 'rename', broken)
+    with pytest.raises(ValueError):
+        cm.charmap()
+
+    with pytest.raises(ValueError):
+        cm.charmap()
diff --git a/tests/cover/test_phases.py b/tests/cover/test_phases.py
index 7aa08ea..85115de 100644
--- a/tests/cover/test_phases.py
... 237 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-hypothesis.git



More information about the Python-modules-commits mailing list