[Python-modules-commits] [python-hypothesis] 01/03: Import python-hypothesis_3.6.0.orig.tar.gz
Tristan Seligmann
mithrandi at moszumanska.debian.org
Tue Nov 8 02:56:29 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 357abc579531c922c1e06b99369cc8f53f08a084
Author: Tristan Seligmann <mithrandi at debian.org>
Date: Mon Nov 7 19:48:35 2016 +0200
Import python-hypothesis_3.6.0.orig.tar.gz
---
.travis.yml | 14 +-
Makefile | 25 +-
README.rst | 2 +-
appveyor.yml | 9 -
benchmarks/test_strategies.py | 2 +-
docs/changes.rst | 88 +++
docs/conf.py | 2 +-
docs/details.rst | 93 +++
docs/settings.rst | 2 +-
docs/usage.rst | 2 +
examples/test_binary_search.py | 25 +-
examples/test_rle.py | 2 +-
hypothesislegacysupport/LICENSE | 662 ---------------------
hypothesislegacysupport/README.rst | 9 -
hypothesislegacysupport/setup.py | 46 --
.../src/hypothesislegacysupport/__init__.py | 30 -
.../src/hypothesislegacysupport/compat.py | 54 --
.../src/hypothesislegacysupport/version.py | 24 -
scripts/basic-test.sh | 4 -
scripts/check_encoding_header.py | 2 +-
scripts/enforce_header.py | 2 +-
scripts/header.py | 2 +-
scripts/install.sh | 2 +-
scripts/unicodechecker.py | 2 +-
setup.py | 4 +-
src/hypothesis/__init__.py | 5 +-
src/hypothesis/_settings.py | 17 +-
src/hypothesis/configuration.py | 2 +-
src/hypothesis/control.py | 32 +-
src/hypothesis/core.py | 33 +-
src/hypothesis/database.py | 18 +-
src/hypothesis/errors.py | 10 +-
src/hypothesis/executors.py | 2 +-
src/hypothesis/extra/__init__.py | 2 +-
src/hypothesis/extra/datetime.py | 2 +-
src/hypothesis/extra/django/__init__.py | 2 +-
src/hypothesis/extra/django/models.py | 2 +-
src/hypothesis/extra/fakefactory.py | 2 +-
src/hypothesis/extra/numpy.py | 2 +-
src/hypothesis/extra/pytestplugin.py | 71 ++-
src/hypothesis/internal/__init__.py | 2 +-
src/hypothesis/internal/charmap.py | 2 +-
src/hypothesis/internal/classmap.py | 2 +-
src/hypothesis/internal/compat.py | 84 +--
src/hypothesis/internal/conjecture/__init__.py | 2 +-
src/hypothesis/internal/conjecture/data.py | 11 +-
src/hypothesis/internal/conjecture/engine.py | 72 ++-
src/hypothesis/internal/conjecture/minimizer.py | 2 +-
src/hypothesis/internal/conjecture/utils.py | 34 +-
src/hypothesis/internal/debug.py | 2 +-
src/hypothesis/internal/deferredformat.py | 42 ++
.../hypothesis/internal/detection.py | 10 +-
src/hypothesis/internal/floats.py | 2 +-
src/hypothesis/internal/intervalsets.py | 2 +-
src/hypothesis/internal/reflection.py | 5 +-
src/hypothesis/reporting.py | 2 +-
src/hypothesis/searchstrategy/__init__.py | 2 +-
src/hypothesis/searchstrategy/collections.py | 2 +-
src/hypothesis/searchstrategy/deferred.py | 2 +-
src/hypothesis/searchstrategy/fixed.py | 2 +-
src/hypothesis/searchstrategy/flatmapped.py | 2 +-
src/hypothesis/searchstrategy/misc.py | 7 +-
src/hypothesis/searchstrategy/numbers.py | 15 +-
src/hypothesis/searchstrategy/recursive.py | 41 +-
src/hypothesis/searchstrategy/reprwrapper.py | 2 +-
src/hypothesis/searchstrategy/shared.py | 2 +-
src/hypothesis/searchstrategy/strategies.py | 17 +-
src/hypothesis/searchstrategy/streams.py | 2 +-
src/hypothesis/searchstrategy/strings.py | 2 +-
src/hypothesis/searchstrategy/wrappers.py | 2 +-
src/hypothesis/stateful.py | 12 +-
src/hypothesis/statistics.py | 84 +++
src/hypothesis/strategies.py | 167 ++++--
src/hypothesis/strategytests.py | 2 +-
src/hypothesis/tools/__init__.py | 2 +-
src/hypothesis/tools/mergedbs.py | 2 +-
src/hypothesis/types.py | 2 +-
src/hypothesis/utils/__init__.py | 5 +-
src/hypothesis/utils/conventions.py | 2 +-
src/hypothesis/utils/dynamicvariables.py | 2 +-
src/hypothesis/vendor/__init__.py | 2 +-
src/hypothesis/vendor/pretty.py | 25 +-
src/hypothesis/version.py | 4 +-
tests/__init__.py | 2 +-
tests/common/__init__.py | 2 +-
tests/common/setup.py | 2 +-
tests/common/utils.py | 4 +-
tests/conftest.py | 2 +-
tests/cover/__init__.py | 2 +-
tests/cover/test_arbitrary_data.py | 2 +-
tests/cover/test_bad_repr.py | 2 +-
tests/cover/test_caching.py | 2 +-
tests/cover/test_charmap.py | 2 +-
tests/cover/test_choices.py | 2 +-
tests/cover/test_classmap.py | 2 +-
tests/cover/test_composite.py | 2 +-
tests/cover/test_conjecture_engine.py | 2 +-
tests/cover/test_conjecture_minimizer.py | 2 +-
tests/cover/test_conjecture_test_data.py | 2 +-
tests/cover/test_conjecture_utils.py | 2 +-
tests/cover/test_control.py | 31 +-
tests/cover/test_conventions.py | 2 +-
tests/cover/test_core.py | 4 +-
tests/cover/test_custom_reprs.py | 2 +-
tests/cover/test_database_agreement.py | 2 +-
tests/cover/test_database_backend.py | 21 +-
tests/cover/test_database_usage.py | 2 +-
tests/cover/test_deferred_errors.py | 2 +-
tests/cover/test_detection.py | 67 +++
tests/cover/test_direct_strategies.py | 151 +++--
tests/cover/test_draw_example.py | 2 +-
tests/cover/test_dynamic_variable.py | 2 +-
tests/cover/test_eval_as_source.py | 2 +-
tests/cover/test_example.py | 2 +-
tests/cover/test_executors.py | 2 +-
tests/cover/test_explicit_examples.py | 2 +-
tests/cover/test_fancy_repr.py | 2 +-
tests/cover/test_filestorage.py | 2 +-
tests/cover/test_filtering.py | 2 +-
tests/cover/test_find.py | 2 +-
tests/cover/test_fixed_strategies.py | 2 +-
tests/cover/test_flakiness.py | 2 +-
tests/cover/test_flatmap.py | 2 +-
tests/cover/test_float_nastiness.py | 2 +-
tests/cover/test_given_error_conditions.py | 2 +-
tests/cover/test_health_checks.py | 2 +-
tests/cover/test_imports.py | 2 +-
tests/cover/test_integer_ranges.py | 2 +-
tests/cover/test_interleaving.py | 2 +-
tests/cover/test_internal_helpers.py | 2 +-
tests/cover/test_intervalset.py | 2 +-
tests/cover/test_limits.py | 2 +-
tests/cover/test_map.py | 2 +-
tests/cover/test_nothing.py | 2 +-
tests/cover/test_numerics.py | 2 +-
tests/cover/test_permutations.py | 2 +-
tests/cover/test_phases.py | 2 +-
tests/cover/test_pretty.py | 16 +-
tests/cover/test_random_module.py | 2 +-
tests/cover/test_randomization.py | 2 +-
tests/cover/test_recursive.py | 8 +-
tests/cover/test_reflection.py | 2 +-
tests/cover/test_reporting.py | 2 +-
tests/cover/test_runner_strategy.py | 2 +-
tests/cover/test_sampled_from.py | 2 +-
tests/cover/test_searchstrategy.py | 2 +-
tests/cover/test_sets.py | 2 +-
tests/cover/test_settings.py | 2 +-
tests/cover/test_setup_teardown.py | 2 +-
tests/cover/test_sharing.py | 2 +-
tests/cover/test_shrinking_limits.py | 2 +-
tests/cover/test_simple_characters.py | 2 +-
tests/cover/test_simple_collections.py | 2 +-
tests/cover/test_simple_numbers.py | 2 +-
tests/cover/test_simple_strings.py | 2 +-
tests/cover/test_stateful.py | 2 +-
tests/cover/test_statistical_events.py | 133 +++++
tests/cover/test_strategytests.py | 2 +-
tests/cover/test_streams.py | 2 +-
tests/cover/test_testdecorators.py | 20 +-
tests/cover/test_threading.py | 2 +-
tests/cover/test_timeout.py | 2 +-
tests/cover/test_uuids.py | 2 +-
tests/cover/test_validation.py | 2 +-
tests/cover/test_verbosity.py | 2 +-
tests/cover/test_weird_settings.py | 2 +-
tests/datetime/__init__.py | 2 +-
tests/datetime/test_dates.py | 2 +-
tests/datetime/test_datetime.py | 4 +-
tests/datetime/test_times.py | 2 +-
tests/django/__init__.py | 2 +-
tests/django/manage.py | 2 +-
tests/django/toys/__init__.py | 2 +-
tests/django/toys/settings.py | 2 +-
tests/django/toys/urls.py | 2 +-
tests/django/toys/wsgi.py | 2 +-
tests/django/toystore/__init__.py | 2 +-
tests/django/toystore/admin.py | 2 +-
tests/django/toystore/models.py | 2 +-
tests/django/toystore/test_basic_configuration.py | 2 +-
tests/django/toystore/test_given_models.py | 2 +-
tests/django/toystore/views.py | 2 +-
tests/fakefactory/__init__.py | 2 +-
tests/fakefactory/test_fake_factory.py | 2 +-
tests/nocover/__init__.py | 2 +-
tests/nocover/test_choices.py | 2 +-
tests/nocover/test_collective_minimization.py | 4 +-
tests/nocover/test_compat.py | 2 +-
tests/nocover/test_descriptortests.py | 2 +-
tests/nocover/test_example_quality.py | 12 +-
tests/nocover/test_floating.py | 2 +-
tests/nocover/test_git_merge.py | 2 +-
tests/nocover/test_pretty_repr.py | 2 +-
tests/nocover/test_recursive.py | 2 +-
tests/nocover/test_statistical_distribution.py | 23 +-
tests/nocover/test_strategy_state.py | 7 +-
tests/nocover/test_streams.py | 2 +-
tests/numpy/__init__.py | 2 +-
tests/numpy/test_gen_data.py | 2 +-
tests/py2/__init__.py | 2 +-
tests/py2/test_destructuring.py | 2 +-
tests/py3/__init__.py | 2 +-
.../version.py => tests/py3/test_annotations.py | 11 +-
tests/py3/test_asyncio.py | 2 +-
tests/py3/test_unicode_identifiers.py | 2 +-
tests/pytest/test_capture.py | 2 +-
tests/pytest/test_compat.py | 2 +-
.../test_doctest.py} | 20 +-
tests/pytest/test_mark.py | 25 +-
tests/pytest/test_profiles.py | 2 +-
tests/pytest/test_reporting.py | 2 +-
tests/pytest/test_runs.py | 2 +-
tests/pytest/test_statistics.py | 113 ++++
tox.ini | 49 +-
214 files changed, 1541 insertions(+), 1402 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7ece066..7be0a17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,16 +29,14 @@ env:
- TASK=check-ancient-pip
- TASK=check-pypy
- TASK=check-py35
- - TASK=check-py26
- TASK=check-py27
- TASK=check-py273
- TASK=check-py34
- TASK=check-nose
- - TASK=check-pytest27
- - TASK=check-pytest26
+ - TASK=check-pytest28
- TASK=check-fakefactory052
- TASK=check-fakefactory053
- - TASK=check-pytest26
+ - TASK=check-fakefactory060
- TASK=check-django17
- TASK=check-django18
@@ -48,8 +46,12 @@ script:
matrix:
exclude:
- os: osx
+ env: TASK=check-pytest28
+ - os: osx
env: TASK=check-py273
- os: osx
+ env: TASK=check-py34
+ - os: osx
env: TASK=check-unicode
- os: osx
env: TASK=check-ancient-pip
@@ -58,9 +60,7 @@ matrix:
- os: osx
env: TASK=check-fakefactory053
- os: osx
- env: TASK=check-pytest26
- - os: osx
- env: TASK=check-pytest27
+ env: TASK=check-fakefactory060
- os: osx
env: TASK=documentation
- os: osx
diff --git a/Makefile b/Makefile
index ef1f921..651fee8 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,6 @@ export BUILD_RUNTIMES?=$(HOME)/.cache/hypothesis-build-runtimes
export TOX_WORK_DIR=$(BUILD_RUNTIMES)/.tox
export COVERAGE_FILE=$(BUILD_RUNTIMES)/.coverage
-PY26=$(BUILD_RUNTIMES)/snakepit/python2.6
PY27=$(BUILD_RUNTIMES)/snakepit/python2.7
PY273=$(BUILD_RUNTIMES)/snakepit/python2.7.3
PY33=$(BUILD_RUNTIMES)/snakepit/python3.3
@@ -37,9 +36,6 @@ TOOL_INSTALL=$(TOOL_PIP) install --upgrade
export PATH:=$(BUILD_RUNTIMES)/snakepit:$(TOOLS):$(PATH)
export LC_ALL=en_US.UTF-8
-$(PY26):
- scripts/retry.sh scripts/install.sh 2.6
-
$(PY27):
scripts/retry.sh scripts/install.sh 2.7
@@ -73,11 +69,11 @@ format: $(PYFORMAT) $(ISORT)
$(TOOL_PYTHON) scripts/enforce_header.py
# isort will sort packages differently depending on whether they're installed
$(ISORT_VIRTUALENV)/bin/python -m pip install django pytz pytest fake-factory numpy flaky
- find src tests hypothesislegacysupport examples -name '*.py' | xargs env -i \
+ find src tests examples -name '*.py' | xargs env -i \
PATH="$(PATH)" $(ISORT) -p hypothesis -ls -m 2 -w 75 \
-a "from __future__ import absolute_import, print_function, division" \
- -rc src tests examples hypothesislegacysupport/src
- find src tests hypothesislegacysupport examples -name '*.py' | xargs $(PYFORMAT) -i
+ -rc src tests examples
+ find src tests examples -name '*.py' | xargs $(PYFORMAT) -i
lint: $(FLAKE8)
$(FLAKE8) src tests --exclude=compat.py,test_reflection.py,test_imports.py,tests/py2 --ignore=E731,E721
@@ -86,9 +82,6 @@ check-format: format
find src tests -name "*.py" | xargs $(TOOL_PYTHON) scripts/check_encoding_header.py
git diff --exit-code
-check-py26: $(PY26) $(TOX)
- $(TOX) -e py26-full
-
check-py27: $(PY27) $(TOX)
$(TOX) -e py27-full
@@ -110,6 +103,12 @@ check-pypy: $(PYPY) $(TOX)
check-nose: $(TOX) $(PY35)
$(TOX) -e nose
+check-pytest30: $(TOX) $(PY35)
+ $(TOX) -e pytest30
+
+check-pytest28: $(TOX) $(PY35)
+ $(TOX) -e pytest28
+
check-pytest27: $(TOX) $(PY35)
$(TOX) -e pytest27
@@ -122,6 +121,9 @@ check-ancient-pip: $(PY273)
check-pytest: check-pytest26 check-pytest27
+check-fakefactory060: $(TOX) $(PY35)
+ $(TOX) -e fakefactory060
+
check-fakefactory052: $(TOX) $(PY35)
$(TOX) -e fakefactory052
@@ -155,7 +157,7 @@ check-noformat: check-coverage check-py26 check-py27 check-py33 check-py34 check
check: check-format check-noformat
-check-fast: lint $(PY26) $(PY35) $(PYPY) $(TOX)
+check-fast: lint $(PY35) $(PYPY) $(TOX)
$(TOX) -e pypy-brief
$(TOX) -e py35-brief
$(TOX) -e py26-brief
@@ -169,6 +171,7 @@ $(TOX): $(PY35) tox.ini $(TOOLS)
$(SPHINX_BUILD): $(TOOL_VIRTUALENV)
$(TOOL_PYTHON) -m pip install sphinx sphinx-rtd-theme
+ $(TOOL_PYTHON) -m pip install -e .
ln -sf $(TOOL_VIRTUALENV)/bin/sphinx-build $(SPHINX_BUILD)
$(SPHINX_AUTOBUILD): $(TOOL_VIRTUALENV)
diff --git a/README.rst b/README.rst
index de9e76b..8da33c4 100644
--- a/README.rst
+++ b/README.rst
@@ -46,4 +46,4 @@ If you want to contribute to Hypothesis, `instructions are here <https://github.
If you want to hear from people who are already using Hypothesis, some of them `have written
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 <https://hypothesis.readthedocs.io/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/appveyor.yml b/appveyor.yml
index 4ee1118..a1888de 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -6,14 +6,6 @@ environment:
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\scripts\\run_with_env.cmd"
matrix:
- - PYTHON: "C:\\Python26"
- PYTHON_VERSION: "2.6.9"
- PYTHON_ARCH: "32"
-
- - PYTHON: "C:\\Python26-x64"
- PYTHON_VERSION: "2.6.9"
- PYTHON_ARCH: "64"
-
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"
@@ -52,7 +44,6 @@ install:
- "%CMD_IN_ENV% python -m pip.__main__ install --upgrade setuptools pip"
- "%CMD_IN_ENV% python -m pip.__main__ install setuptools pytest==2.8.0 flaky"
- "%CMD_IN_ENV% python -m pip.__main__ install .[all]"
- - "%CMD_IN_ENV% python -m pip.__main__ install --upgrade ./hypothesislegacysupport"
build: false # Not a C# project, build stuff at the test step instead.
diff --git a/benchmarks/test_strategies.py b/benchmarks/test_strategies.py
index ca48322..5ccde9d 100644
--- a/benchmarks/test_strategies.py
+++ b/benchmarks/test_strategies.py
@@ -3,7 +3,7 @@
# 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
+# Most of this work is copyright (C) 2013-2016 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
diff --git a/docs/changes.rst b/docs/changes.rst
index 205224e..c0e311d 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -21,6 +21,94 @@ Hypothesis APIs come in three flavours:
You should generally assume that an API is internal unless you have specific
information to the contrary.
+------------------
+3.6.0 - 2016-10-31
+------------------
+
+This release reverts Hypothesis to its old pretty printing of lambda functions
+based on attempting to extract the source code rather than decompile the bytecode.
+This is unfortunately slightly inferior in some cases and may result in you
+occasionally seeing things like lambda x: <unknown> in statistics reports and
+strategy reprs.
+
+This removes the dependencies on uncompyle6, xdis and spark-parser.
+
+The reason for this is that the new functionality was based on uncompyle6, which
+turns out to introduce a hidden GPLed dependency - it in turn depended on xdis,
+and although the library was licensed under the MIT license, it contained some
+GPL licensed source code and thus should have been released under the GPL.
+
+My interpretation is that Hypothesis itself was never in violation of the GPL
+(because the license it is under, the Mozilla Public License v2, is fully
+compatible with being included in a GPL licensed work), but I have not consulted
+a lawyer on the subject. Regardless of the answer to this question, adding a
+GPLed dependency will likely cause a lot of users of Hypothesis to inadvertently
+be in violation of the GPL.
+
+As a result, if you are running Hypothesis 3.5.x you really should upgrade to
+this release immediately.
+
+------------------
+3.5.3 - 2016-10-05
+------------------
+
+This is a bug fix release.
+
+Bugs fixed:
+
+* If the same test was running concurrently in two processes and there were
+ examples already in the test database which no longer failed, Hypothesis
+ would sometimes fail with a FileNotFoundError (IOError on Python 2) because
+ an example it was trying to read was deleted before it was read. (Issue
+ `#372 <https://github.com/HypothesisWorks/hypothesis-python/issues/372>`_).
+* Drawing from an integers() strategy with both a min_value and a max_value
+ would reject too many examples needlessly. Now it repeatedly redraws until
+ satisfied. (Pull request `#366 <https://github.com/HypothesisWorks/hypothesis-python/pull/366>`_.
+ Thanks to Calen Pennington for the contribution).
+
+------------------
+3.5.2 - 2016-09-24
+------------------
+
+This is a bug fix release.
+
+* The Hypothesis pytest plugin broke pytest support for doctests. Now it doesn't.
+
+------------------
+3.5.1 - 2016-09-23
+------------------
+
+This is a bug fix release.
+
+* Hypothesis now runs cleanly in -B and -BB modes, avoiding mixing bytes and unicode.
+* unittest.TestCase tests would now have shown up in the new statistics mode. Now they
+ do.
+* Similarly, stateful tests would not have shown up in statistics and now they do.
+* Statistics now print with pytest node IDs (the names you'd get in pytest verbose mode).
+
+------------------
+3.5.0 - 2016-09-22
+------------------
+
+This is a feature release.
+
+* fractions() and decimals() strategies now support min_value and max_value
+ parameters. Thanks go to Anne Mulhern for the development of this feature.
+* The Hypothesis pytest plugin now supports a --hypothesis-show-statistics parameter
+ that gives detailed statistics about the tests that were run. Huge thanks to
+ Jean-Louis Fuchs and Adfinis-SyGroup for funding the development of this feature.
+* There is a new event() function that can be used to add custom statistics.
+
+Additionally there have been some minor bug fixes:
+
+* In some cases Hypothesis should produce fewer duplicate examples (this will mostly
+ only affect cases with a single parameter).
+* py.test command line parameters are now under an option group for Hypothesis (thanks
+ to David Keijser for fixing this)
+* Hypothesis would previously error if you used function annotations on your tests under
+ Python 3.4.
+* The repr of many strategies using lambdas has been improved to include the lambda body
+ (this was previously supported in many but not all cases).
------------------
3.4.2 - 2016-07-13
diff --git a/docs/conf.py b/docs/conf.py
index b705f57..84ce410 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -3,7 +3,7 @@
# 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
+# Most of this work is copyright (C) 2013-2016 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
diff --git a/docs/details.rst b/docs/details.rst
index c516d61..aaf9439 100644
--- a/docs/details.rst
+++ b/docs/details.rst
@@ -42,6 +42,99 @@ intermediate steps of your test. That's where the ``note`` function comes in:
The note is printed in the final run of the test in order to include any
additional information you might need in your test.
+
+---------------
+Test Statistics
+---------------
+
+If you are using py.test you can see a number of statistics about the executed tests
+by passing the command line argument --hypothesis-show-statistics. This will include
+some general statistics about the test:
+
+For example if you ran the following with --hypothesis-show-statistics:
+
+.. code-block:: python
+
+ from hypothesis import given, strategies as st
+
+ @given(st.integers())
+ def test_integers(i):
+ pass
+
+
+You would see:
+
+.. code-block:: none
+
+ test_integers:
+
+ - 200 passing examples, 0 failing examples, 0 invalid examples
+ - Typical runtimes: < 1ms
+ - Stopped because settings.max_examples=200
+
+
+The final "Stopped because" line is particularly important to note: It tells you the
+setting value that determined when the test should stop trying new examples. This
+can be useful for understanding the behaviour of your tests. Ideally you'd always want
+this to be max_examples.
+
+In some cases (such as filtered and recursive strategies) you will see events mentioned
+which describe some aspect of the data generation:
+
+.. code-block:: python
+
+ from hypothesis import given, strategies as st
+
+ @given(st.integers().filter(lambda x: x % 2 == 0))
+ def test_even_integers(i):
+ pass
+
+You would see something like:
+
+.. code-block:: none
+
+ test_even_integers:
+
+ - 200 passing examples, 0 failing examples, 16 invalid examples
+ - Typical runtimes: < 1ms
+ - Stopped because settings.max_examples=200
+ - Events:
+ * 30.56%, Retried draw from integers().filter(lambda x: x % 2 == 0) to satisfy filter
+ * 7.41%, Aborted test because unable to satisfy integers().filter(lambda x: x % 2 == 0)
+
+
+You can also mark custom events in a test using the 'event' function:
+
+
+.. code:: python
+
+ from hypothesis import given, event, strategies as st
+
+ @given(st.integers().filter(lambda x: x % 2 == 0))
+ def test_even_integers(i):
+ event("i mod 3 = %d" % (i % 3,))
+
+
+You will then see output like:
+
+
+.. code-block:: none
+
+ test_even_integers:
+
+ - 200 passing examples, 0 failing examples, 28 invalid examples
+ - Typical runtimes: < 1ms
+ - Stopped because settings.max_examples=200
+ - Events:
+ * 47.81%, Retried draw from integers().filter(lambda x: x % 2 == 0) to satisfy filter
+ * 31.14%, i mod 3 = 2
+ * 28.95%, i mod 3 = 1
+ * 27.63%, i mod 3 = 0
+ * 12.28%, Aborted test because unable to satisfy integers().filter(lambda x: x % 2 == 0)
+
+Arguments to event() can be any hashable type, but two events will be considered the same
+if they are the same when converted to a string with str().
+
------------------
Making assumptions
------------------
diff --git a/docs/settings.rst b/docs/settings.rst
index d2a808d..4323f27 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -1,5 +1,5 @@
========
-settings
+Settings
========
Hypothesis tries to have good defaults for its behaviour, but sometimes that's
diff --git a/docs/usage.rst b/docs/usage.rst
index ce9cebf..b847dfd 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -14,12 +14,14 @@ then it should be available on pypi.
* `chardet <https://pypi.python.org/pypi/chardet>`_
* `cmph-cffi <https://github.com/URXtech/cmph-cffi>`_
* `cryptography <https://github.com/pyca/cryptography>`_
+* `dbus-signature-pyparsing <https://github.com/stratis-storage/dbus-signature-pyparsing>`_
* `fastnumbers <https://github.com/SethMMorton/fastnumbers>`_
* `flocker <https://github.com/ClusterHQ/flocker>`_
* `flownetpy <https://github.com/debsankha/flownetpy>`_
* `funsize <https://github.com/mozilla/funsize>`_
* `fusion-index <https://github.com/fusionapp/fusion-index>`_
* `hyper-h2 <https://github.com/python-hyper/hyper-h2>`_
+* `into-dbus-python <https://github.com/stratis-storage/into-dbus-python>`_
* `justbases <https://github.com/mulkieran/justbases>`_
* `justbytes <https://github.com/mulkieran/justbytes>`_
* `mariadb-dyncol <https://github.com/adamchainz/mariadb-dyncol>`_
diff --git a/examples/test_binary_search.py b/examples/test_binary_search.py
index 7dfae4e..e125feb 100644
--- a/examples/test_binary_search.py
+++ b/examples/test_binary_search.py
@@ -3,7 +3,7 @@
# 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
+# Most of this work is copyright (C) 2013-2016 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
@@ -103,20 +103,17 @@ SortedLists = st.lists(Values).map(sorted)
@given(ls=SortedLists, v=Values)
def test_insert_is_sorted(ls, v):
- """
- We test the first invariant: binary_search should return an index such that
- inserting the value provided at that index would result in a sorted set.
- """
+ """We test the first invariant: binary_search should return an index such
+ that inserting the value provided at that index would result in a sorted
+ set."""
ls.insert(binary_search(ls, v), v)
assert is_sorted(ls)
@given(ls=SortedLists, v=Values)
def test_is_minimal(ls, v):
- """
- We test the second invariant: binary_search should return an index such
- that no smaller index is a valid insertion point for v
- """
+ """We test the second invariant: binary_search should return an index such
+ that no smaller index is a valid insertion point for v."""
for i in range(binary_search(ls, v)):
ls2 = list(ls)
ls2.insert(i, v)
@@ -125,11 +122,10 @@ def test_is_minimal(ls, v):
@given(ls=SortedLists, v=Values)
def test_inserts_into_same_place_twice(ls, v):
- """
- In this we test a *consequence* of the second invariant: When we insert a
- value into a list twice, the insertion point should be the same both times.
- This is because we know that v is > the previous element and == the next
- element.
+ """In this we test a *consequence* of the second invariant: When we insert
+ a value into a list twice, the insertion point should be the same both
+ times. This is because we know that v is > the previous element and == the
+ next element.
In theory if the former passes, this should always pass. In practice,
failures are detected by this test with much higher probability because it
@@ -138,6 +134,7 @@ def test_inserts_into_same_place_twice(ls, v):
This is an instance of a good general category of test: Testing how the
function moves in responses to changes in the underlying data.
+
"""
i = binary_search(ls, v)
ls.insert(i, v)
diff --git a/examples/test_rle.py b/examples/test_rle.py
index aea2972..7714808 100644
--- a/examples/test_rle.py
+++ b/examples/test_rle.py
@@ -3,7 +3,7 @@
# 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
+# Most of this work is copyright (C) 2013-2016 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
diff --git a/hypothesislegacysupport/LICENSE b/hypothesislegacysupport/LICENSE
deleted file mode 100644
index 79c3877..0000000
--- a/hypothesislegacysupport/LICENSE
+++ /dev/null
@@ -1,662 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
... 5652 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