[Python-modules-commits] [python-hypothesis] 01/06: Import python-hypothesis_3.1.3.orig.tar.gz
Tristan Seligmann
mithrandi at moszumanska.debian.org
Sun May 15 01:09:52 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 63f5cef9b61cac6b06d4c6683b0a05e6157479cc
Author: Tristan Seligmann <mithrandi at debian.org>
Date: Sun May 15 02:43:41 2016 +0200
Import python-hypothesis_3.1.3.orig.tar.gz
---
.travis.yml | 4 +
CITATION | 19 +
CONTRIBUTING.rst | 6 +-
Makefile | 16 +-
README.rst | 52 +-
appveyor.yml | 17 +-
benchmarks/test_strategies.py | 9 +-
docs/changes.rst | 39 ++
docs/conf.py | 9 +-
docs/endorsements.rst | 11 +
docs/examples.rst | 27 +-
docs/extras.rst | 53 ++
docs/index.rst | 4 +-
docs/usage.rst | 6 +-
examples/test_binary_search.py | 9 +-
examples/test_rle.py | 9 +-
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 | 11 +-
scripts/check-ancient-pip.sh | 17 +
scripts/check_encoding_header.py | 9 +-
scripts/enforce_header.py | 2 +-
scripts/header.py | 9 +-
scripts/install.sh | 5 +
scripts/unicodechecker.py | 9 +-
setup.py | 17 +-
src/hypothesis/__init__.py | 9 +-
src/hypothesis/_settings.py | 9 +-
src/hypothesis/configuration.py | 13 +-
src/hypothesis/control.py | 9 +-
src/hypothesis/core.py | 13 +-
src/hypothesis/database.py | 25 +-
src/hypothesis/errors.py | 9 +-
src/hypothesis/executors.py | 9 +-
src/hypothesis/extra/__init__.py | 9 +-
src/hypothesis/extra/datetime.py | 9 +-
src/hypothesis/extra/django/__init__.py | 9 +-
src/hypothesis/extra/django/models.py | 9 +-
src/hypothesis/extra/fakefactory.py | 9 +-
src/hypothesis/extra/numpy.py | 9 +-
src/hypothesis/extra/pytestplugin.py | 9 +-
src/hypothesis/internal/__init__.py | 9 +-
src/hypothesis/internal/charmap.py | 25 +-
src/hypothesis/internal/classmap.py | 9 +-
src/hypothesis/internal/compat.py | 36 +-
src/hypothesis/internal/conjecture/__init__.py | 9 +-
src/hypothesis/internal/conjecture/data.py | 9 +-
src/hypothesis/internal/conjecture/engine.py | 9 +-
src/hypothesis/internal/conjecture/minimizer.py | 9 +-
src/hypothesis/internal/conjecture/utils.py | 28 +-
src/hypothesis/internal/debug.py | 9 +-
src/hypothesis/internal/floats.py | 9 +-
src/hypothesis/internal/intervalsets.py | 9 +-
src/hypothesis/internal/reflection.py | 9 +-
src/hypothesis/reporting.py | 9 +-
src/hypothesis/searchstrategy/__init__.py | 9 +-
src/hypothesis/searchstrategy/collections.py | 15 +-
src/hypothesis/searchstrategy/deferred.py | 9 +-
src/hypothesis/searchstrategy/fixed.py | 9 +-
src/hypothesis/searchstrategy/flatmapped.py | 9 +-
src/hypothesis/searchstrategy/misc.py | 9 +-
src/hypothesis/searchstrategy/numbers.py | 9 +-
src/hypothesis/searchstrategy/recursive.py | 9 +-
src/hypothesis/searchstrategy/reprwrapper.py | 9 +-
src/hypothesis/searchstrategy/shared.py | 9 +-
src/hypothesis/searchstrategy/strategies.py | 9 +-
src/hypothesis/searchstrategy/streams.py | 9 +-
src/hypothesis/searchstrategy/strings.py | 9 +-
src/hypothesis/searchstrategy/wrappers.py | 9 +-
src/hypothesis/stateful.py | 10 +-
src/hypothesis/strategies.py | 10 +-
src/hypothesis/strategytests.py | 9 +-
src/hypothesis/tools/__init__.py | 9 +-
src/hypothesis/tools/mergedbs.py | 9 +-
src/hypothesis/types.py | 9 +-
src/hypothesis/utils/__init__.py | 9 +-
src/hypothesis/utils/conventions.py | 9 +-
src/hypothesis/utils/dynamicvariables.py | 9 +-
src/hypothesis/utils/size.py | 9 +-
src/hypothesis/vendor/__init__.py | 9 +-
src/hypothesis/vendor/pretty.py | 11 +-
src/hypothesis/version.py | 11 +-
tests/__init__.py | 9 +-
tests/common/__init__.py | 9 +-
tests/common/setup.py | 9 +-
tests/common/utils.py | 9 +-
tests/conftest.py | 9 +-
tests/cover/__init__.py | 9 +-
tests/cover/test_arbitrary_data.py | 9 +-
tests/cover/test_bad_repr.py | 9 +-
tests/cover/test_caching.py | 9 +-
tests/cover/test_charmap.py | 9 +-
tests/cover/test_choices.py | 9 +-
tests/cover/test_classmap.py | 9 +-
tests/cover/test_composite.py | 9 +-
tests/cover/test_conjecture_engine.py | 11 +-
tests/cover/test_conjecture_minimizer.py | 9 +-
tests/cover/test_conjecture_test_data.py | 9 +-
tests/cover/test_conjecture_utils.py | 9 +-
tests/cover/test_control.py | 9 +-
tests/cover/test_conventions.py | 9 +-
tests/cover/test_core.py | 9 +-
tests/cover/test_custom_reprs.py | 9 +-
tests/cover/test_database_agreement.py | 9 +-
tests/cover/test_database_backend.py | 9 +-
tests/cover/test_database_usage.py | 9 +-
tests/cover/test_deferred_errors.py | 9 +-
tests/cover/test_direct_strategies.py | 9 +-
tests/cover/test_draw_example.py | 9 +-
tests/cover/test_dynamic_variable.py | 9 +-
tests/cover/test_eval_as_source.py | 9 +-
tests/cover/test_example.py | 9 +-
tests/cover/test_executors.py | 9 +-
tests/cover/test_explicit_examples.py | 9 +-
tests/cover/test_fancy_repr.py | 9 +-
tests/cover/test_filestorage.py | 9 +-
tests/cover/test_filtering.py | 9 +-
tests/cover/test_find.py | 9 +-
tests/cover/test_fixed_strategies.py | 9 +-
tests/cover/test_flakiness.py | 9 +-
tests/cover/test_flatmap.py | 9 +-
tests/cover/test_float_nastiness.py | 9 +-
tests/cover/test_given_error_conditions.py | 9 +-
tests/cover/test_health_checks.py | 9 +-
tests/cover/test_imports.py | 9 +-
tests/cover/test_integer_ranges.py | 9 +-
tests/cover/test_interleaving.py | 9 +-
tests/cover/test_internal_helpers.py | 9 +-
tests/cover/test_intervalset.py | 9 +-
tests/cover/test_limits.py | 9 +-
tests/cover/test_map.py | 9 +-
tests/cover/test_nothing.py | 9 +-
tests/cover/test_numerics.py | 9 +-
tests/cover/test_permutations.py | 9 +-
tests/cover/test_phases.py | 9 +-
tests/cover/test_pretty.py | 16 +-
tests/cover/test_random_module.py | 9 +-
tests/cover/test_randomization.py | 9 +-
tests/cover/test_recursive.py | 9 +-
tests/cover/test_reflection.py | 9 +-
tests/cover/test_reporting.py | 9 +-
tests/cover/test_runner_strategy.py | 9 +-
tests/cover/test_sampled_from.py | 9 +-
tests/cover/test_searchstrategy.py | 9 +-
tests/cover/test_sets.py | 9 +-
tests/cover/test_settings.py | 9 +-
tests/cover/test_setup_teardown.py | 9 +-
tests/cover/test_sharing.py | 9 +-
tests/cover/test_shrinking_limits.py | 9 +-
tests/cover/test_simple_characters.py | 9 +-
tests/cover/test_simple_collections.py | 9 +-
tests/cover/test_simple_numbers.py | 9 +-
tests/cover/test_simple_strings.py | 9 +-
tests/cover/test_sizes.py | 9 +-
tests/cover/test_stateful.py | 22 +-
tests/cover/test_strategytests.py | 9 +-
tests/cover/test_streams.py | 9 +-
tests/cover/test_testdecorators.py | 9 +-
tests/cover/test_timeout.py | 9 +-
tests/cover/test_uuids.py | 9 +-
tests/cover/test_validation.py | 9 +-
tests/cover/test_verbosity.py | 9 +-
tests/cover/test_weird_settings.py | 9 +-
tests/datetime/__init__.py | 9 +-
tests/datetime/test_dates.py | 9 +-
tests/datetime/test_datetime.py | 9 +-
tests/datetime/test_times.py | 9 +-
tests/django/__init__.py | 9 +-
tests/django/manage.py | 9 +-
tests/django/toys/__init__.py | 9 +-
tests/django/toys/settings.py | 9 +-
tests/django/toys/urls.py | 9 +-
tests/django/toys/wsgi.py | 9 +-
tests/django/toystore/__init__.py | 9 +-
tests/django/toystore/admin.py | 9 +-
tests/django/toystore/models.py | 9 +-
tests/django/toystore/test_basic_configuration.py | 9 +-
tests/django/toystore/test_given_models.py | 9 +-
tests/django/toystore/views.py | 9 +-
tests/fakefactory/__init__.py | 9 +-
tests/fakefactory/test_fake_factory.py | 9 +-
tests/nocover/__init__.py | 9 +-
tests/nocover/test_choices.py | 9 +-
tests/nocover/test_collective_minimization.py | 9 +-
tests/nocover/test_compat.py | 9 +-
tests/nocover/test_descriptortests.py | 9 +-
tests/nocover/test_example_quality.py | 35 +-
tests/nocover/test_floating.py | 9 +-
tests/nocover/test_git_merge.py | 23 +-
tests/nocover/test_pretty_repr.py | 9 +-
tests/nocover/test_recursive.py | 24 +-
tests/nocover/test_statistical_distribution.py | 17 +-
tests/nocover/test_strategy_state.py | 9 +-
tests/nocover/test_streams.py | 9 +-
tests/numpy/__init__.py | 9 +-
tests/numpy/test_gen_data.py | 9 +-
tests/py2/__init__.py | 9 +-
tests/py2/test_destructuring.py | 9 +-
tests/py3/__init__.py | 9 +-
tests/py3/test_asyncio.py | 9 +-
tests/py3/test_unicode_identifiers.py | 9 +-
tests/pytest/test_capture.py | 9 +-
tests/pytest/test_compat.py | 9 +-
tests/pytest/test_mark.py | 9 +-
tests/pytest/test_profiles.py | 9 +-
tests/pytest/test_reporting.py | 9 +-
tests/pytest/test_runs.py | 9 +-
tox.ini | 11 +-
212 files changed, 2135 insertions(+), 882 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index f4abca4..7ece066 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,8 +26,10 @@ env:
- TASK=check-format
- TASK=check-coverage
- TASK=check-unicode
+ - TASK=check-ancient-pip
- TASK=check-pypy
- TASK=check-py35
+ - TASK=check-py26
- TASK=check-py27
- TASK=check-py273
- TASK=check-py34
@@ -50,6 +52,8 @@ matrix:
- os: osx
env: TASK=check-unicode
- os: osx
+ env: TASK=check-ancient-pip
+ - os: osx
env: TASK=check-fakefactory052
- os: osx
env: TASK=check-fakefactory053
diff --git a/CITATION b/CITATION
new file mode 100644
index 0000000..6ac50a5
--- /dev/null
+++ b/CITATION
@@ -0,0 +1,19 @@
+Please use one of the following samples to cite the hypothesis version (change
+x.y) from this installation
+
+Text:
+
+[Hypothesis] Hypothesis x.y, 2016
+David R. MacIver, https://github.com/DRMacIver/hypothesis
+
+BibTeX:
+
+ at misc{Hypothesisx.y,
+ title = {{H}ypothesis x.y},
+ author = {David R. MacIver},
+ year = {2016},
+ howpublished = {\href{https://github.com/DRMacIver/hypothesis}{\texttt{https://github.com/DRMacIver/hypothesis}}},
+}
+
+If you are unsure about which version of hypothesis you are using run: `pip show
+hypothesis`.
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index e364b30..75bb30a 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -34,9 +34,9 @@ OK, so you want to make a contribution and have sorted out the legalese. What no
First off: If you're planning on implementing a new feature, talk to me first! I'll probably
tell you to go for it, but I might have some feedback on aspects of it or tell you how it fits
-into the broader scheme of things. Remember: A feature is for 1.x, not just for Christmas. Once
+into the broader scheme of things. Remember: A feature is for 3.x, not just for Christmas. Once
a feature is in, it can only be evolved in backwards compatible ways until I bump the "I can break
-your code" number and release Hypothesis 2.0. This means I spend a lot of time thinking about
+your code" number and release Hypothesis 4.0. This means I spend a lot of time thinking about
getting features right. It may sometimes also mean I reject your feature, or feel you need to
rethink it, so it's best to have that conversation early.
@@ -140,6 +140,8 @@ their individual contributions.
* `Chris Down <https://chrisdown.name>`_
* `Christopher Martin <https://www.github.com/chris-martin>`_ (`ch.martin at gmail.com <mailto:ch.martin at gmail.com>`_)
* `Cory Benfield <https://www.github.com/Lukasa>`_
+* `Cristi Cobzarenco <https://github.com/cristicbz>`_ (`cristi at reinfer.io <mailto:cristi at reinfer.io>`_)
+* `David Bonner <https://github.com/rascalking>`_ (`dbonner at gmail.com <mailto:dbonner at gmail.com>`_)
* `Derek Gustafson <https://www.github.com/degustaf>`_
* `Florian Bruhin <https://www.github.com/The-Compiler>`_
* `follower <https://www.github.com/follower>`_
diff --git a/Makefile b/Makefile
index aa4a367..e3da186 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ ISORT=$(TOOLS)/isort
FLAKE8=$(TOOLS)/flake8
PYFORMAT=$(TOOLS)/pyformat
+BROKEN_VIRTUALENV=$(BUILD_RUNTIMES)/virtualenvs/broken
TOOL_VIRTUALENV=$(BUILD_RUNTIMES)/virtualenvs/tools
ISORT_VIRTUALENV=$(BUILD_RUNTIMES)/virtualenvs/isort
TOOL_PYTHON=$(TOOL_VIRTUALENV)/bin/python
@@ -32,7 +33,7 @@ TOOL_PIP=$(TOOL_VIRTUALENV)/bin/pip
TOOL_INSTALL=$(TOOL_PIP) install --upgrade
export PATH:=$(BUILD_RUNTIMES)/snakepit:$(TOOLS):$(PATH)
-export LC_ALL=C.UTF-8
+export LC_ALL=en_US.UTF-8
$(PY26):
scripts/retry.sh scripts/install.sh 2.6
@@ -68,10 +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
- env -i PATH="$(PATH)" $(ISORT) -p hypothesis -ls -m 2 -w 75 \
+ find src tests hypothesislegacysupport 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
- find src tests examples -name '*.py' | xargs $(PYFORMAT) -i
+ -rc src tests examples hypothesislegacysupport/src
+ find src tests hypothesislegacysupport 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
@@ -110,6 +112,10 @@ check-pytest27: $(TOX) $(PY35)
check-pytest26: $(TOX) $(PY35)
$(TOX) -e pytest26
+check-ancient-pip: $(PY273)
+ scripts/check-ancient-pip.sh $(PY273)
+
+
check-pytest: check-pytest26 check-pytest27
check-fakefactory052: $(TOX) $(PY35)
@@ -159,7 +165,7 @@ $(TOX): $(PY35) tox.ini $(TOOLS)
touch $(TOOL_VIRTUALENV)/bin/tox $(TOX)
$(SPHINX_BUILD): $(TOOL_VIRTUALENV)
- $(TOOL_PYTHON) -m pip install sphinx
+ $(TOOL_PYTHON) -m pip install sphinx sphinx-rtd-theme
ln -sf $(TOOL_VIRTUALENV)/bin/sphinx-build $(SPHINX_BUILD)
$(SPHINX_AUTOBUILD): $(TOOL_VIRTUALENV)
diff --git a/README.rst b/README.rst
index 45cde7c..2ccc894 100644
--- a/README.rst
+++ b/README.rst
@@ -2,34 +2,38 @@
Hypothesis
==========
-Hypothesis is a library for testing your Python code against a much larger range
-of examples than you would ever want to write by hand. It's based on the Haskell
-library, Quickcheck, and is designed to integrate seamlessly into your existing
-Python unit testing work flow.
+Hypothesis is an advanced testing library for Python. It lets you write tests which
+are parametrized by a source of examples, and then generates simple and comprehensible
+examples that make your tests fail. This lets you find more bugs in your code with less
+work.
-Hypothesis is both extremely practical and also advances the state of the art of
-unit testing by some way. It's easy to use, stable, and extremely powerful. If
-you're not using Hypothesis to test your project then you're missing out.
+e.g.
+
+.. code-block:: python
-------------------
-Versions supported
-------------------
+ @given(st.lists(
+ st.floats(allow_nan=False, allow_infinity=False), min_size=1))
+ def test_mean(xs):
+ assert min(xs) <= mean(xs) <= max(xs)
-Hypothesis officially supports CPython 2.7, 3.4 and 3.5, as well as PyPy. Other
-versions are not supported. Patches for such versions are accepted as long as
-they don't impose a maintenance burden. However, keep in mind that this does
-not automatically mean that future releases of Hypothesis will continue to work
-on those versions.
+.. code-block::
-See `Issue #286 <https://github.com/DRMacIver/hypothesis/issues/286>`_ for more
-information.
+ Falsifying example: test_mean(
+ xs=[1.7976321109618856e+308, 6.102390043022755e+303]
+ )
+
+Hypothesis is extremely practical and advances the state of the art of
+unit testing by some way. It's easy to use, stable, and powerful. If
+you're not using Hypothesis to test your project then you're missing out.
-----------------
Links of interest
-----------------
-To learn more about how to use Hypothesis, extensive documentation and
-examples of usage are `available at readthedocs <https://hypothesis.readthedocs.org/en/master/>`_.
+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/>`_.
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>`_.
@@ -37,17 +41,9 @@ and a mailing list <https://hypothesis.readthedocs.org/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/DRMacIver/hypothesis/blob/master/CONTRIBUTING.rst>`_.
+If you want to contribute to Hypothesis, `instructions are here <https://github.com/Hypothesis/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>`_.
If you want to create a downstream package of Hypothesis, please read `these guidelines for packagers <http://hypothesis.readthedocs.org/en/latest/packaging.html>`_
-
--------------------
-Ongoing Development
--------------------
-
-Development on Hypothesis is a mix of community provided and sponsored. If you wish to contribute,
-either financially or through code, `you can read more about the process in the documentation
-<http://hypothesis.readthedocs.org/en/latest/development.html>`_.
diff --git a/appveyor.yml b/appveyor.yml
index 85ff3c6..4ee1118 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -6,6 +6,14 @@ 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"
@@ -41,9 +49,10 @@ install:
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- - "%CMD_IN_ENV% python -m pip install --upgrade setuptools pip"
- - "%CMD_IN_ENV% python -m pip install setuptools pytest==2.8.0 flaky"
- - "%CMD_IN_ENV% python -m pip install .[all]"
+ - "%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.
@@ -52,5 +61,5 @@ test_script:
- "%CMD_IN_ENV% python -m pytest tests/cover"
- "%CMD_IN_ENV% python -m pytest tests/datetime"
- "%CMD_IN_ENV% python -m pytest tests/fakefactory"
- - "%CMD_IN_ENV% python -m pip uninstall flaky -y"
+ - "%CMD_IN_ENV% python -m pip.__main__ uninstall flaky -y"
- "%CMD_IN_ENV% python -m pytest tests/pytest -p pytester --runpytest subprocess"
diff --git a/benchmarks/test_strategies.py b/benchmarks/test_strategies.py
index 9c7749d..ca48322 100644
--- a/benchmarks/test_strategies.py
+++ b/benchmarks/test_strategies.py
@@ -1,12 +1,13 @@
# coding=utf-8
#
-# This file is part of Hypothesis (https://github.com/DRMacIver/hypothesis)
+# 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
-# https://github.com/DRMacIver/hypothesis/blob/master/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.
+# 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
diff --git a/docs/changes.rst b/docs/changes.rst
index aee59d6..1e38e06 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -22,6 +22,45 @@ You should generally assume that an API is internal unless you have specific
information to the contrary.
------------------
+3.1.3 - 2016-05-01
+------------------
+
+Single bug fix release
+
+* Another charmap problem. In 3.1.2 text/characters would break on systems
+ which had /tmp/ mounted on a different partition than the Hypothesis storage
+ directory (usually in home). This fixes that.
+
+------------------
+3.1.2 - 2016-04-30
+------------------
+
+Single bug fix release:
+
+* Anything which used a text() or characters() strategy was broken on Windows
+ and I hadn't updated appveyor to use the new repository location so I didn't
+ notice. This is now fixed and windows support should work correctly.
+
+------------------
+3.1.1 - 2016-04-29
+------------------
+
+Minor bug fix release.
+
+* Fix concurrency issue when running tests that use text() from multiple
+ processes at once (Bug #302, thanks to Alex Chan).
+* Improve performance of code using lists with max_size (thanks to
+ Cristi Cobzarenco).
+* Fix install on Python 2 with ancient versions of pip so that it installs the
+ enum34 backport (thanks to Donald Stufft for telling me how to do this).
+* Remove duplicated __all__ exports from hypothesis.strategies (thanks to
+ Piët Delport).
+* Update headers to point to new repository location.
+* Allow use of strategies that can't be used in find() (e.g. choices) in
+ stateful testing.
+
+
+------------------
3.1.0 - 2016-03-06
------------------
diff --git a/docs/conf.py b/docs/conf.py
index c03f9bd..b705f57 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,12 +1,13 @@
# coding=utf-8
#
-# This file is part of Hypothesis (https://github.com/DRMacIver/hypothesis)
+# 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
-# https://github.com/DRMacIver/hypothesis/blob/master/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.
+# 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
diff --git a/docs/endorsements.rst b/docs/endorsements.rst
index 1c8ace2..91b3895 100644
--- a/docs/endorsements.rst
+++ b/docs/endorsements.rst
@@ -107,6 +107,17 @@ all.
When it comes to validating the correctness of your tools, nothing comes close
to the thoroughness and power of Hypothesis.
+------------------------------------------
+`Jon Moore <https://github.com/jonmoore>`_
+------------------------------------------
+
+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
+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.
+
-------------------------------------------
`Your name goes here <http://example.com>`_
-------------------------------------------
diff --git a/docs/examples.rst b/docs/examples.rst
index f9e7249..a3e582a 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -387,14 +387,13 @@ then use the result and go on to do other things are definitely also possible.
.. code:: python
import unittest
- from hypothesis import given, assume, settings
+ from hypothesis import given, assume, settings, strategies as st
from collections import namedtuple
import requests
import os
import random
import time
import math
- from hypothesis.strategies import one_of, sampled_from, lists
# These tests will be quite slow because we have to talk to an external
# service. Also we'll put in a sleep between calls so as to not hammer it.
@@ -411,19 +410,19 @@ then use the result and go on to do other things are definitely also possible.
assert waspfinder_token is not None
assert waspfinder_user is not None
- GoalData = {
- 'title': str,
- 'goal_type': sampled_from(lists
+ GoalData = st.fixed_dictionaries({
+ 'title': st.text(),
+ 'goal_type': st.sampled_from([
"hustler", "biker", "gainer", "fatloser", "inboxer",
- "drinker", "custom")),
- 'goaldate': one_of((None, float)),
- 'goalval': one_of((None, float)),
- 'rate': one_of((None, float)),
- 'initval': float,
- 'panic': float,
- 'secret': bool,
- 'datapublic': bool,
- }
+ "drinker", "custom"]),
+ 'goaldate': st.one_of(st.none(), st.floats()),
+ 'goalval': st.one_of(st.none(), st.floats()),
+ 'rate': st.one_of(st.none(), st.floats()),
+ 'initval': st.floats(),
+ 'panic': st.floats(),
+ 'secret': st.booleans(),
+ 'datapublic': st.booleans(),
+ })
needs2 = ['goaldate', 'goalval', 'rate']
diff --git a/docs/extras.rst b/docs/extras.rst
index e64225e..dcc0aa2 100644
--- a/docs/extras.rst
+++ b/docs/extras.rst
@@ -197,3 +197,56 @@ slightly better integrated example reporting when using @given and running
under pytest.
It can also load :ref:`settings Profiles <settings_profiles>`.
+
+------------------
+hypothesis[numpy]
+------------------
+
+hypothesis.extra.numpy adds support for testing
+`NumPy <http://www.numpy.org/>`_-based implementations with Hypothesis by
+providing an ``arrays`` function.
+
+It lives in the ``hypothesis.extra.numpy`` package.
+
+.. method:: arrays(dtype, shape, elements=None)
+
+ Arrays of specified `dtype` and `shape` are generated for example
+ like this:
+
+ .. code-block:: pycon
+
+ >>> import numpy as np
+ >>> arrays(np.int8, (2, 3)).example()
+ array([[-8, 6, 3],
+ [-6, 4, 6]], dtype=int8)
+
+
+ However, to obtain more fine grained control over the elements, use
+ the `elements` keyword (see also :doc:`What you can generate and how <data>`):
+
+ .. code-block:: pycon
+
+ >>> import numpy as np
+ >>> from hypothesis.strategies import floats
+ >>> arrays(np.float, 3, elements=floats(min_value=0, max_value=1)).example()
+ array([ 0.88974794, 0.77387938, 0.1977879 ])
+
+ By combining different strategies, the shape of the array can be modified as well:
+
+ .. code-block:: pycon
+
+ >>> import numpy as np
+ >>> from hypothesis.strategies import integers, floats
+ >>>
+ >>> def rnd_len_arrays(dtype, min_len=0, max_len=3, elements=None):
+ ... lengths = integers(min_value=min_len, max_value=max_len)
+ ... return lengths.flatmap(lambda n: arrays(dtype, n, elements=elements))
+ ...
+ >>>
+ >>> rla = rnd_len_arrays(np.int8)
+ >>> rla.example()
+ array([], dtype=int8)
+ >>> rla.example()
+ array([-2], dtype=int8)
+ >>> rla.example()
+ array([ 7, -6, -2], dtype=int8)
diff --git a/docs/index.rst b/docs/index.rst
index 6e2c06d..1f0e3fd 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -47,7 +47,9 @@ number of sections, which you can see in the sidebar (or the
menu at the top if you're on mobile), but you probably want to begin with
the :doc:`Quick start guide <quickstart>`, which will give you a worked
example of how to use Hypothesis and a detailed outline
-of the things you need to know to begin testing your code with it.
+of the things you need to know to begin testing your code with it, or
+check out some of the
+`introductory articles <http://hypothesis.works/articles/intro/>`_.
.. toctree::
diff --git a/docs/usage.rst b/docs/usage.rst
index acb2472..fdf630e 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -11,7 +11,7 @@ then it should be available on pypi.
* `bidict <https://github.com/jab/bidict>`_
* `binaryornot <https://github.com/audreyr/binaryornot>`_
* `brotlipy <https://github.com/python-hyper/brotlipy>`_
-* `chardet <https://pypi.python.org/pypi/chardetn>`_
+* `chardet <https://pypi.python.org/pypi/chardet>`_
* `cmph-cffi <https://github.com/URXtech/cmph-cffi>`_
* `cryptography <https://github.com/pyca/cryptography>`_
* `fastnumbers <https://github.com/SethMMorton/fastnumbers>`_
@@ -20,11 +20,14 @@ then it should be available on pypi.
* `funsize <https://github.com/mozilla/funsize>`_
* `fusion-index <https://github.com/fusionapp/fusion-index>`_
* `hyper-h2 <https://github.com/python-hyper/hyper-h2>`_
+* `justbases <https://github.com/mulkieran/justbases>`_
+* `justbytes <https://github.com/mulkieran/justbytes>`_
* `mariadb-dyncol <https://github.com/adamchainz/mariadb-dyncol>`_
* `mercurial <https://www.mercurial-scm.org/>`_
* `natsort <https://github.com/SethMMorton/natsort>`_
* `pretext <https://github.com/moreati/b-prefix-all-the-doctests>`_
* `priority <https://github.com/python-hyper/priority>`_
+* `PyPy <http://pypy.org>`_
* `pyrsistent <https://github.com/tobgu/pyrsistent>`_
* `pyudev <https://github.com/pyudev/pyudev>`_
* `qutebrowser <https://github.com/The-Compiler/qutebrowser>`_
@@ -33,5 +36,6 @@ then it should be available on pypi.
* `simoa <https://github.com/andsor/pysimoa>`_
* `srt <https://github.com/cdown/srt>`_
* `tchannel <https://github.com/uber/tchannel-python>`_
+* `vdirsyncer <https://github.com/untitaker/vdirsyncer>`_
* `wcag-contrast-ratio <https://github.com/gsnedders/wcag-contrast-ratio>`_
* `yturl <https://github.com/cdown/yturl>`_
diff --git a/examples/test_binary_search.py b/examples/test_binary_search.py
index 7cf3194..7dfae4e 100644
--- a/examples/test_binary_search.py
+++ b/examples/test_binary_search.py
@@ -1,12 +1,13 @@
# coding=utf-8
#
-# This file is part of Hypothesis (https://github.com/DRMacIver/hypothesis)
+# 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
-# https://github.com/DRMacIver/hypothesis/blob/master/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.
+# 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
diff --git a/examples/test_rle.py b/examples/test_rle.py
index a60c57b..aea2972 100644
--- a/examples/test_rle.py
+++ b/examples/test_rle.py
@@ -1,12 +1,13 @@
# coding=utf-8
#
-# This file is part of Hypothesis (https://github.com/DRMacIver/hypothesis)
+# 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
-# https://github.com/DRMacIver/hypothesis/blob/master/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.
+# 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
diff --git a/hypothesislegacysupport/LICENSE b/hypothesislegacysupport/LICENSE
new file mode 100644
index 0000000..79c3877
--- /dev/null
+++ b/hypothesislegacysupport/LICENSE
@@ -0,0 +1,662 @@
+ 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:
... 5359 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