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

Tristan Seligmann mithrandi at moszumanska.debian.org
Tue Feb 23 12:49:49 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 0a3b85eee61321c771e053e1353cc5007a59f0de
Author: Tristan Seligmann <mithrandi at debian.org>
Date:   Tue Feb 23 13:15:55 2016 +0200

    Import python-hypothesis_3.0.3.orig.tar.gz
---
 CONTRIBUTING.rst                     |  2 ++
 docs/changes.rst                     |  8 ++++++++
 docs/extras.rst                      |  8 +++++---
 docs/healthchecks.rst                |  8 +++-----
 docs/packaging.rst                   |  2 --
 docs/settings.rst                    | 16 ++++++++--------
 setup.py                             |  1 +
 src/hypothesis/core.py               | 17 +++++++++++++++++
 src/hypothesis/extra/pytestplugin.py |  9 ++++++++-
 src/hypothesis/strategies.py         |  2 +-
 src/hypothesis/version.py            |  2 +-
 11 files changed, 54 insertions(+), 21 deletions(-)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 03bda7c..7a6cffd 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -145,8 +145,10 @@ their individual contributions.
 * `follower <https://www.github.com/follower>`_
 * `Jonty Wareing <https://www.github.com/Jonty>`_ (`jonty at jonty.co.uk <mailto:jonty at jonty.co.uk>`_)
 * `kbara <https://www.github.com/kbara>`_
+* `Lee Begg <https://www.github.com/llnz2>`_
 * `marekventur <https://www.github.com/marekventur>`_
 * `Marius Gedminas <https://www.github.com/mgedmin>`_ (`marius at gedmin.as <mailto:marius at gedmin.as>`_)
+* `Markus Unterwaditzer <http://github.com/untitaker/>`_ (`markus at unterwaditzer.net <mailto:markus at unterwaditzer.net>`_)
 * `Matt Bachmann <https://www.github.com/bachmann1234>`_ (`bachmann.matt at gmail.com <mailto:bachmann.matt at gmail.com>`_)
 * `Nicholas Chammas <https://www.github.com/nchammas>`_
 * `Richard Boulton <https://www.github.com/rboulton>`_ (`richard at tartarus.org <mailto:richard at tartarus.org>`_)
diff --git a/docs/changes.rst b/docs/changes.rst
index 197ecc1..1792817 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -21,6 +21,14 @@ Hypothesis APIs come in three flavours:
 You should generally assume that an API is internal unless you have specific
 information to the contrary.
 
+------------------
+3.0.3 - 2016-02-23
+------------------
+
+* Fix version parsing of py.test to work with py.test release candidates
+* More general handling of the health check problem where things could fail because
+  of a cache miss - now one "free" example is generated before the start of the
+  health check run.
 
 ------------------
 3.0.2 - 2016-02-18
diff --git a/docs/extras.rst b/docs/extras.rst
index 7745d19..e64225e 100644
--- a/docs/extras.rst
+++ b/docs/extras.rst
@@ -101,7 +101,7 @@ It lives in the ``hypothesis.extra.datetime`` package.
     arguments.
 
 
-.. method:: times()
+.. method:: times(allow_naive=None, timezones=None)
 
     This strategy generates ``time`` objects. For example:
 
@@ -109,9 +109,11 @@ It lives in the ``hypothesis.extra.datetime`` package.
 
         >>> from hypothesis.extra.datetime import times
         >>> times().example()
-        datetime.time(0, 15, 55, 188712)
+        datetime.time(0, 15, 55, 188712, tzinfo=<DstTzInfo 'US/Hawaii' LMT-1 day, 13:29:00 STD>)
         >>> times().example()
-        datetime.time(9, 0, 47, 959374)
+        datetime.time(9, 0, 47, 959374, tzinfo=<DstTzInfo 'Pacific/Bougainville' BST+11:00:00 STD>)
+
+    The ``allow_naive`` and ``timezones`` arguments act the same as the datetimes strategy.
 
 
 -----------------------
diff --git a/docs/healthchecks.rst b/docs/healthchecks.rst
index 63b1e50..e9c3cba 100644
--- a/docs/healthchecks.rst
+++ b/docs/healthchecks.rst
@@ -17,8 +17,6 @@ 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 two settings:
-
-* If the strict setting is set to True, these will be exceptions instead of warnings.
-* If the perform_health_check setting is set to False, these health checks will be skipped entirely. This is not
-  recommended.
+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.
diff --git a/docs/packaging.rst b/docs/packaging.rst
index d9a7f2a..6d7696a 100644
--- a/docs/packaging.rst
+++ b/docs/packaging.rst
@@ -38,9 +38,7 @@ Python versions
 Hypothesis is designed to work with a range of Python versions. Currently supported are:
 
 * pypy-2.6.1 (earlier versions of pypy *may* work)
-* CPython 2.6.x
 * CPython 2.7.x
-* CPython 3.3.x
 * CPython 3.4.x
 * CPython 3.5.x
 
diff --git a/docs/settings.rst b/docs/settings.rst
index 1414d21..7245c31 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
+        database, perform_health_check
 
 .. _verbose-output:
 
@@ -71,28 +71,28 @@ of verbose output are, well, verbose, but they should convey the idea).
     Shrunk example to [True]
     [True]
     >>> from hypothesis import given
-    >>> from hypothesis.strategies import integers()
-    >>> settings.default.verbosity = Verbosity.verbose
-    >>> @given(integers())
+    >>> from hypothesis.strategies import integers
+    >>> @given(integers(), settings=settings(verbosity=Verbosity.verbose))
     ... def test_foo(x):
     ...     assert x > 0
     ...
     >>> test_foo()
     Trying example: test_foo(x=-565872324465712963891750807252490657219)
     Traceback (most recent call last):
-      ...
+        ...
+        File "<stdin>", line 3, in test_foo
     AssertionError
     Trying example: test_foo(x=565872324465712963891750807252490657219)
     Trying example: test_foo(x=0)
     Traceback (most recent call last):
-    ...
+        ...
+        File "<stdin>", line 3, in test_foo
     AssertionError
     Falsifying example: test_foo(x=0)
     Traceback (most recent call last):
-    ...
+        ...
     AssertionError
 
-
 The four levels are quiet, normal, verbose and debug. normal is the default,
 while in quiet Hypothesis will not print anything out, even the final
 falsifying example. debug is basically verbose but a bit more so. You probably
diff --git a/setup.py b/setup.py
index 904367b..184f561 100644
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,7 @@ extras[":python_version == '2.6'"] = [
     'importlib', 'ordereddict', 'Counter', 'enum34']
 
 extras[":python_version == '2.7'"] = ['enum34']
+extras[":python_version == '3.3'"] = ['enum34']
 
 
 setup(
diff --git a/src/hypothesis/core.py b/src/hypothesis/core.py
index 343ac28..bd97b1e 100644
--- a/src/hypothesis/core.py
+++ b/src/hypothesis/core.py
@@ -287,6 +287,23 @@ def given(*generator_arguments, **generator_kwargs):
             if perform_health_check:
                 initial_state = getglobalrandomstate()
                 health_check_random = Random(random.getrandbits(128))
+                # We "pre warm" the health check with one draw to give it some
+                # time to calculate any cached data. This prevents the case
+                # where the first draw of the health check takes ages because
+                # of loading unicode data the first time.
+                data = TestData(
+                    max_length=settings.buffer_size,
+                    draw_bytes=lambda data, n, distribution:
+                    distribution(health_check_random, n)
+                )
+                with Settings(settings, verbosity=Verbosity.quiet):
+                    try:
+                        test_runner(data, reify_and_execute(
+                            search_strategy,
+                            lambda *args, **kwargs: None,
+                        ))
+                    except BaseException:
+                        pass
                 count = 0
                 overruns = 0
                 filtered_draws = 0
diff --git a/src/hypothesis/extra/pytestplugin.py b/src/hypothesis/extra/pytestplugin.py
index 49e3f9d..12cc547 100644
--- a/src/hypothesis/extra/pytestplugin.py
+++ b/src/hypothesis/extra/pytestplugin.py
@@ -16,11 +16,18 @@
 
 from __future__ import division, print_function, absolute_import
 
+import re
+
 import pytest
 
 from hypothesis.reporting import default as default_reporter
 
-PYTEST_VERSION = tuple(map(int, pytest.__version__.split('.')[:3]))
+PYTEST_VERSION = tuple(
+    map(
+        int,
+        re.sub('-.+', '', pytest.__version__).split('.')
+    ))[:3]
+
 LOAD_PROFILE_OPTION = '--hypothesis-profile'
 
 if PYTEST_VERSION >= (2, 7, 0):
diff --git a/src/hypothesis/strategies.py b/src/hypothesis/strategies.py
index 4fe45d0..6be651c 100644
--- a/src/hypothesis/strategies.py
+++ b/src/hypothesis/strategies.py
@@ -993,7 +993,7 @@ def check_valid_interval(lower_bound, upper_bound, lower_name, upper_name):
     """Checks that lower_bound and upper_bound are either unspecified, or they
     define a valid interval on the number line.
 
-    Otherwise raises InvalidArgumet.
+    Otherwise raises InvalidArgument.
 
     """
     if lower_bound is None or upper_bound is None:
diff --git a/src/hypothesis/version.py b/src/hypothesis/version.py
index 6c56165..60c0c2c 100644
--- a/src/hypothesis/version.py
+++ b/src/hypothesis/version.py
@@ -16,5 +16,5 @@
 
 from __future__ import division, print_function, absolute_import
 
-__version_info__ = (3, 0, 2)
+__version_info__ = (3, 0, 3)
 __version__ = '.'.join(map(str, __version_info__))

-- 
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