14
0
Files
python-hypothesis/python-hypothesis.spec

237 lines
8.5 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-hypothesis
#
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
# Without complete tests for SLES to avoid python-pandas requirement
%if 0%{?suse_version} <= 1600
%bcond_with complete_tests
%else
%bcond_without complete_tests
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%bcond_with ringdisabled
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
# Magic for OBS Staging. Only build the flavors required by
# other packages in the ring.
%if %{with ringdisabled}
ExclusiveArch: do_not_build
%endif
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-hypothesis%{psuffix}
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
Version: 6.138.13
Release: 0
Summary: A library for property based testing
License: MPL-2.0
URL: https://github.com/HypothesisWorks/hypothesis
# Source is the `hypothesis-python` subdir of the Github repository.
- update to 6.92.1: * This release adds an experimental :wikipedia:`observability * This patch fixes an issue where :func:`~hypothesis.strategies.builds` could not be used with :pypi:`attrs` objects that defined private attributes (i.e. attributes with a leading underscore). See also * This release adds an optional ``payload`` argument to :func:`hypothesis.event`, so that you can clearly express the difference between the label and the value of an observation. * This patch supports assigning ``settings = settings(...)`` as a class attribute on a subclass of a ``.TestCase`` attribute of a :class:`~hypothesis.stateful.RuleBasedStateMachine`. * This release makes it an error to assign ``settings = settings(...)`` as a class attribute on a :class:`~hypothesis.stateful.RuleBasedStateMachine`. * This patch refactors some internals. There is no user- visible change, but we hope to improve performance and unlock support for alternative backends such as :pypi:`symbolic execution with crosshair in future (:issue:`3086`). * This release teaches :func:`~hypothesis.strategies.from_type` to handle constraints implied by the :pypi:`annotated-types` package - as used by e.g. :pypi:`Pydantic`. * This patch adds a warning when :func:`@st.composite wraps a function annotated as returning a :class:`~hypothesis.strategies.SearchStrategy`, since this is usually an error (:issue:`3786`). * This patch refactors ``from_type(typing.Tuple)``, allowing :func:`~hypothesis.strategies.register_type_strategy` to take effect for tuples instead of being silently ignored OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=179
2023-12-27 10:15:20 +00:00
# Edit the `_service` file and run `osc service manualrun` for updates.
# See also https://hypothesis.readthedocs.io/en/latest/packaging.html
Source: hypothesis-python-%{version}.tar.gz
Accepting request 1116915 from home:mimi_vx:branches:devel:languages:python - Update to 6.87.3 * This patch ensures that the :ref:`hypothesis codemod <codemods>` CLI will print a warning instead of stopping with an internal error if one of your files contains invalid syntax (:issue:`3759`). * This patch makes some small changes to our NumPy integration to ensure forward compatibility. * Fixes :issue:`3755`, where an internal condition turns out to be reachable after all. * This release deprecates use of :func:`~hypothesis.assume` and reject() outside of property-based tests, because these functions work by raising a special exception (:issue:`3743`). It also fixes some type annotations (:issue:`3753`). * Hotfix for :issue:`3747`, a bug in explain mode which is so rare that we missed it in six months of dogfooding. Thanks to :pypi:`mygrad` for discovering and promptly reporting this! * This patch improves the documentation of :obj:`@example(...).xfail() <hypothesis.example.xfail>` by adding a note about PEP 614, similar to :obj:`@example(...).via() <hypothesis.example.via>`, and adds a warning when a strategy generates a test case which seems identical to one provided by an xfailed example. * This release enables the :obj:`~hypothesis.Phase.explain` :ref:`phase <phases>` by default. We hope it helps you to understand why your failing tests have failed! * This patch switches some of our type annotations to use :obj:`typing.Literal` when only a few specific values are allowed, such as UUID or IP address versions. * This release deprecates the old whitelist/blacklist arguments to :func:`~hypothesis.strategies.characters`, in favor of include/exclude arguments which more clearly describe their effects on the set of characters which can be generated. OBS-URL: https://build.opensuse.org/request/show/1116915 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=174
2023-10-11 12:12:14 +00:00
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytz}
Accepting request 963086 from home:bnavigator:branches:devel:languages:python - Update to 6.39.4 * This patch tweaks some internal formatting. There is no user-visible change. - Release 6.39.3 * If the shrink phase is disabled, we now stop the generate phase as soon as an error is found regardless of the value of the report_multiple_examples setting, since that’s probably what you wanted (issue #3244). - Release 6.39.2 * This patch clarifies rare error messages in builds() (issue #3225) and floats() (issue #3207). - Release 6.39.1 * This patch fixes a regression where the bound inner function (your_test.hypothesis.inner_test) would be invoked with positional arguments rather than passing them by name, which broke pytest-asyncio (issue #3245). - 6.39.0 * This release improves Hypothesis’ handling of positional-only arguments, which are now allowed @st.composite strategies. * On Python 3.8 and later, the first arguments to builds() and from_model() are now natively positional-only. In cases which were already errors, the TypeError from incorrect usage will therefore be raises immediately when the function is called, rather than when the strategy object is used. - Release 6.38.0 * This release makes floats() error consistently when your floating-point hardware has been configured to violate IEEE-754 for subnormal numbers, instead of only when an internal assertion was tripped (issue #3092). * If this happens to you, passing allow_subnormal=False will suppress the explicit error. However, we strongly recommend fixing the root cause by disabling global-effect unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne’s Beware of fast-math explainer first. - Release 6.37.2 * This patch fixes a bug in stateful testing, where returning a single value wrapped in multiple() would be printed such that the assigned variable was a tuple rather than the single element (issue #3236). - Release 6.37.1 * This patch fixes a warning under pytest 7 relating to our rich traceback display logic (issue #3223). - Release 6.37.0 * When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of PEP 654 ExceptionGroups. - Release 6.36.2 * This patch updates our vendored list of top-level domains, which is used by the provisional domains() strategy. - Release 6.36.1 * This patch fixes some deprecation warnings from pytest 7.0, along with some code formatting and docs updates. - Release 6.36.0 * This release disallows using typing.Final with from_type() and register_type_strategy(). * Why? Because Final can only be used during class definition. We don’t generate class attributes. * It also does not make sense as a runtime type on its own. - Release 6.35.1 * This patch fixes hypothesis write output highlighting with rich version 12.0 and later. - Drop importorskip-numpy-pandas.patch OBS-URL: https://build.opensuse.org/request/show/963086 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=150
2022-03-19 23:02:39 +00:00
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-attrs >= 19.2.0
Requires: (python-exceptiongroup >= 1.0.0 if python-base < 3.11)
Requires: (python-sortedcontainers >= 2.1.0 with python-sortedcontainers < 3.0)
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
# SECTION requires_extra
Recommends: (python-importlib_metadata >= 3.6 if python-base < 3.8)
# consuming packages need to declare these optional dependencies explicitly
Accepting request 1217328 from home:glaubitz:branches:devel:languages:python - Update to 6.115.3 * This patch fixes a regression from :ref:`version 6.115.2 <v6.115.2>` where generating values from :func:`~hypothesis.strategies.integers` with certain values for ``min_value`` and ``max_value`` would error. - from version 6.115.2 * This release improves integer shrinking by folding the endpoint upweighting for :func:`~hypothesis.strategies.integers` into the ``weights`` parameter of our IR. If you maintain an alternative backend as part of our (for now explicitly unstable) :ref:`alternative-backends`, this release changes the type of the ``weights`` parameter to ``draw_integer`` and may be a breaking change for you. - from version 6.115.1 * This patch improves the performance of :func:`~hypothesis.strategies.from_type` with `pydantic.types.condate - from version 6.115.0 * This improves the formatting of dataclasses and attrs classes when printing falsifying examples. - from version 6.114.1 * This patch upgrades remaining type annotations to Python 3.9 syntax. - from version 6.114.0 * This release drops support for Python 3.8, which reached end of life on 2024-10-07. - from version 6.113.0 * This release adds ``hypothesis.errors.BackendCannotProceed``, an unstable API for use by :ref:`alternative-backends`. - from version 6.112.5 * This release fixes a regression where :class:`hypothesis.stateful.Bundle` did not work properly with :ref:`flatmap <flatmap>` functionality. - from version 6.112.4 * This patch tweaks the paths in ``@example(...)`` patches, so that OBS-URL: https://build.opensuse.org/request/show/1217328 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=197
2024-10-23 16:58:01 +00:00
Recommends: python-Django >= 4.2
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
Recommends: python-black >= 20.8
Recommends: python-click >= 7.0
Recommends: python-dpcontracts >= 0.4
- Update to 6.61.0 - This release improves our treatment of database keys, which based on (among other things) the source code of your test function. We now post-process this source to ignore decorators, comments, trailing whitespace, and blank lines - so that you can add :obj:`@example() <hypothesis.example>`\ s or make some small no-op edits to your code without preventing replay of any known failing or covering examples. - 6.60.1 - 2022-12-11 - This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__, which is used by the provisional :func:`~hypothesis.provisional.domains` strategy. - 6.60.0 - 2022-12-04 - This release improves Hypothesis' ability to resolve forward references in type annotations. It fixes a bug that prevented :func:`~hypothesis.strategies.builds` from being used with `pydantic models that possess updated forward references <https://pydantic-docs.helpmanual.io/usage/postponed_annotations/>`__. See :issue:`3519`. - 6.59.0 - 2022-12-02 - The :obj:`@example(...) <hypothesis.example>` decorator now has a ``.via()`` method, which future tools will use to track automatically-added covering examples (:issue:`3506`). - 6.58.2 - 2022-11-30 - This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__, which is used by the provisional :func:`~hypothesis.provisional.domains` strategy. - 6.58.1 - 2022-11-26 - This patch shifts ``hypothesis[lark]`` from depending on the old :pypi:`lark-parser` package to the new :pypi:`lark` package. There are no OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=158
2022-12-15 06:51:57 +00:00
Recommends: python-lark >= 0.10.1
Recommends: python-libcst >= 0.3.16
Recommends: python-numpy >= 2
Recommends: python-pandas >= 1.1
Recommends: python-pytest >= 4.6
Recommends: python-python-dateutil >= 1.4
Recommends: python-pytz >= 2014.1
Recommends: python-redis >= 3.0.0
Recommends: python-rich >= 9.0
# /SECTION
%if %{with test}
BuildRequires: %{python_module hypothesis = %{version}}
# SECTION test requirements
Accepting request 982468 from home:bnavigator:branches:devel:languages:python - Update to 6.47.1 * Our pretty-printer no longer sorts dictionary keys, since iteration order is stable in Python 3.7+ and this can affect reproducing examples (issue #3370). This PR was kindly supported by Ordina Pythoneers. - Release 6.47.0 * The Ghostwritter can now write tests for @classmethod or @staticmethod methods, in addition to the existing support for functions and other callables (issue #3318). Thanks to Cheuk Ting Ho for the patch. - Release 6.46.11 * Mention hypothesis.strategies.timezones() in the documentation of hypothesis.strategies.datetimes() for completeness. * Thanks to George Macon for this addition. - Release 6.46.10 * This release contains some small improvements to our documentation. Thanks to Felix Divo for his contribution! - Release 6.46.9 * This patch by Adrian Garcia Badaracco adds type annotations to some private internals (issue #3074). - Release 6.46.8 * This patch by Phillip Schanely makes changes to the floats() strategy when min_value or max_value is present. Hypothesis will now be capable of generating every representable value in the bounds. You may notice that hypothesis is more likely to test values near boundaries, and values that are very close to zero. * These changes also support future integrations with symbolic execution tools and fuzzers (issue #3086). - Release 6.46.7 OBS-URL: https://build.opensuse.org/request/show/982468 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=152
2022-06-14 07:39:05 +00:00
BuildRequires: %{python_module backports.zoneinfo >= 0.2.1 if %python-base < 3.9}
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
BuildRequires: %{python_module black >= 20.8}
BuildRequires: %{python_module click}
BuildRequires: %{python_module dpcontracts >= 0.4}
BuildRequires: %{python_module flaky}
- Update to 6.61.0 - This release improves our treatment of database keys, which based on (among other things) the source code of your test function. We now post-process this source to ignore decorators, comments, trailing whitespace, and blank lines - so that you can add :obj:`@example() <hypothesis.example>`\ s or make some small no-op edits to your code without preventing replay of any known failing or covering examples. - 6.60.1 - 2022-12-11 - This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__, which is used by the provisional :func:`~hypothesis.provisional.domains` strategy. - 6.60.0 - 2022-12-04 - This release improves Hypothesis' ability to resolve forward references in type annotations. It fixes a bug that prevented :func:`~hypothesis.strategies.builds` from being used with `pydantic models that possess updated forward references <https://pydantic-docs.helpmanual.io/usage/postponed_annotations/>`__. See :issue:`3519`. - 6.59.0 - 2022-12-02 - The :obj:`@example(...) <hypothesis.example>` decorator now has a ``.via()`` method, which future tools will use to track automatically-added covering examples (:issue:`3506`). - 6.58.2 - 2022-11-30 - This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__, which is used by the provisional :func:`~hypothesis.provisional.domains` strategy. - 6.58.1 - 2022-11-26 - This patch shifts ``hypothesis[lark]`` from depending on the old :pypi:`lark-parser` package to the new :pypi:`lark` package. There are no OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=158
2022-12-15 06:51:57 +00:00
BuildRequires: %{python_module lark >= 0.10.1}
BuildRequires: %{python_module libcst >= 0.3.16}
BuildRequires: %{python_module numpy >= 2}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pytest >= 4.6}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module python-dateutil >= 1.4}
BuildRequires: %{python_module rich >= 9.0.0}
BuildRequires: %{python_module typing_extensions}
Accepting request 1248637 from home:dgarcia:branches:devel:languages:python - Update to 6.172.2: - Adjust type hints for the pub-sub database implementation in version 6.126.0, and remove a remnant debug print in its implementation. - 6.127.1: - Improve the clarity of printing counterexamples in stateful testing, by avoiding confusing Bundle references with equivalent values drawn from a regular strategy. - 6.127.0: - This releases adds support for type aliases created with the type statement (new in python 3.12) to from_type() and register_type_strategy(). - 6.126.0: - The Hypothesis database now supports a pub-sub interface to efficiently listen for changes in the database, via .add_listener and .remove_listener. While all databases that ship with Hypothesis support this interface, implementing it is not required for custom database subclasses. Hypothesis will warn when trying to listen on a database without support. - This feature is currently only used downstream in hypofuzz. - 6.125.3: - Improves sharing of some internal cache behavior. - 6.125.2: - Optimize performance (improves speed by ~5%) and clarify the wording in an error message. - 6.125.1: - Fixes a bug since around version 6.124.4 where we might have generated -0.0 for st.floats(min_value=0.0), which is unsound. - 6.125.0: - Add 2024.12 to the list of recognized Array API versions in OBS-URL: https://build.opensuse.org/request/show/1248637 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=204
2025-02-26 10:50:33 +00:00
BuildRequires: %{python_module watchdog}
%if %{with complete_tests}
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
BuildRequires: %{python_module Django >= 4.2}
BuildRequires: %{python_module fakeredis}
BuildRequires: %{python_module pandas >= 1.1}
%endif
# /SECTION
%endif
%python_subpackages
%description
Accepting request 963086 from home:bnavigator:branches:devel:languages:python - Update to 6.39.4 * This patch tweaks some internal formatting. There is no user-visible change. - Release 6.39.3 * If the shrink phase is disabled, we now stop the generate phase as soon as an error is found regardless of the value of the report_multiple_examples setting, since that’s probably what you wanted (issue #3244). - Release 6.39.2 * This patch clarifies rare error messages in builds() (issue #3225) and floats() (issue #3207). - Release 6.39.1 * This patch fixes a regression where the bound inner function (your_test.hypothesis.inner_test) would be invoked with positional arguments rather than passing them by name, which broke pytest-asyncio (issue #3245). - 6.39.0 * This release improves Hypothesis’ handling of positional-only arguments, which are now allowed @st.composite strategies. * On Python 3.8 and later, the first arguments to builds() and from_model() are now natively positional-only. In cases which were already errors, the TypeError from incorrect usage will therefore be raises immediately when the function is called, rather than when the strategy object is used. - Release 6.38.0 * This release makes floats() error consistently when your floating-point hardware has been configured to violate IEEE-754 for subnormal numbers, instead of only when an internal assertion was tripped (issue #3092). * If this happens to you, passing allow_subnormal=False will suppress the explicit error. However, we strongly recommend fixing the root cause by disabling global-effect unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne’s Beware of fast-math explainer first. - Release 6.37.2 * This patch fixes a bug in stateful testing, where returning a single value wrapped in multiple() would be printed such that the assigned variable was a tuple rather than the single element (issue #3236). - Release 6.37.1 * This patch fixes a warning under pytest 7 relating to our rich traceback display logic (issue #3223). - Release 6.37.0 * When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of PEP 654 ExceptionGroups. - Release 6.36.2 * This patch updates our vendored list of top-level domains, which is used by the provisional domains() strategy. - Release 6.36.1 * This patch fixes some deprecation warnings from pytest 7.0, along with some code formatting and docs updates. - Release 6.36.0 * This release disallows using typing.Final with from_type() and register_type_strategy(). * Why? Because Final can only be used during class definition. We don’t generate class attributes. * It also does not make sense as a runtime type on its own. - Release 6.35.1 * This patch fixes hypothesis write output highlighting with rich version 12.0 and later. - Drop importorskip-numpy-pandas.patch OBS-URL: https://build.opensuse.org/request/show/963086 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=150
2022-03-19 23:02:39 +00:00
Hypothesis is a family of testing libraries which let you write tests parametrized
by a source of examples. A Hypothesis implementation then generates simple and
comprehensible examples that make your tests fail. This simplifies writing your
tests and makes them more powerful at the same time, by letting software automate
the boring bits and do them to a higher standard than a human would, freeing you
to focus on the higher level test logic.
Accepting request 963086 from home:bnavigator:branches:devel:languages:python - Update to 6.39.4 * This patch tweaks some internal formatting. There is no user-visible change. - Release 6.39.3 * If the shrink phase is disabled, we now stop the generate phase as soon as an error is found regardless of the value of the report_multiple_examples setting, since that’s probably what you wanted (issue #3244). - Release 6.39.2 * This patch clarifies rare error messages in builds() (issue #3225) and floats() (issue #3207). - Release 6.39.1 * This patch fixes a regression where the bound inner function (your_test.hypothesis.inner_test) would be invoked with positional arguments rather than passing them by name, which broke pytest-asyncio (issue #3245). - 6.39.0 * This release improves Hypothesis’ handling of positional-only arguments, which are now allowed @st.composite strategies. * On Python 3.8 and later, the first arguments to builds() and from_model() are now natively positional-only. In cases which were already errors, the TypeError from incorrect usage will therefore be raises immediately when the function is called, rather than when the strategy object is used. - Release 6.38.0 * This release makes floats() error consistently when your floating-point hardware has been configured to violate IEEE-754 for subnormal numbers, instead of only when an internal assertion was tripped (issue #3092). * If this happens to you, passing allow_subnormal=False will suppress the explicit error. However, we strongly recommend fixing the root cause by disabling global-effect unsafe-math compiler options instead, or at least consulting e.g. Simon Byrne’s Beware of fast-math explainer first. - Release 6.37.2 * This patch fixes a bug in stateful testing, where returning a single value wrapped in multiple() would be printed such that the assigned variable was a tuple rather than the single element (issue #3236). - Release 6.37.1 * This patch fixes a warning under pytest 7 relating to our rich traceback display logic (issue #3223). - Release 6.37.0 * When distinguishing multiple errors, Hypothesis now looks at the inner exceptions of PEP 654 ExceptionGroups. - Release 6.36.2 * This patch updates our vendored list of top-level domains, which is used by the provisional domains() strategy. - Release 6.36.1 * This patch fixes some deprecation warnings from pytest 7.0, along with some code formatting and docs updates. - Release 6.36.0 * This release disallows using typing.Final with from_type() and register_type_strategy(). * Why? Because Final can only be used during class definition. We don’t generate class attributes. * It also does not make sense as a runtime type on its own. - Release 6.35.1 * This patch fixes hypothesis write output highlighting with rich version 12.0 and later. - Drop importorskip-numpy-pandas.patch OBS-URL: https://build.opensuse.org/request/show/963086 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=150
2022-03-19 23:02:39 +00:00
This sort of testing is often called "property-based testing", and the most widely
known implementation of the concept is the Haskell library QuickCheck, but
Hypothesis differs significantly from QuickCheck and is designed to fit idiomatically
and easily into existing styles of testing that you are used to, with absolutely no
familiarity with Haskell or functional programming needed.
%prep
%setup -q -n hypothesis-python-%{version}
%autopatch -p1
# gh#HypothesisWorks/hypothesis#2447: make sure arr==0.0 is an array on 32-bit
sed -i 's/assert (arr == 0.0)/assert np.asarray(arr == 0.0)/' tests/numpy/test_gen_data.py
%build
%if !%{with test}
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/hypothesis
%endif
%post
%python_install_alternative hypothesis
%postun
%python_uninstall_alternative hypothesis
%pre
%python_libalternatives_reset_alternative hypothesis
%check
%if %{with test}
# theses tests try to write into global python_sitelib
# https://github.com/HypothesisWorks/hypothesis/issues/2546
donttest="test_updating_the_file_include_new_shrinkers"
donttest+=" or test_can_learn_to_normalize_the_unnormalized"
- update to 6.92.1: * This release adds an experimental :wikipedia:`observability * This patch fixes an issue where :func:`~hypothesis.strategies.builds` could not be used with :pypi:`attrs` objects that defined private attributes (i.e. attributes with a leading underscore). See also * This release adds an optional ``payload`` argument to :func:`hypothesis.event`, so that you can clearly express the difference between the label and the value of an observation. * This patch supports assigning ``settings = settings(...)`` as a class attribute on a subclass of a ``.TestCase`` attribute of a :class:`~hypothesis.stateful.RuleBasedStateMachine`. * This release makes it an error to assign ``settings = settings(...)`` as a class attribute on a :class:`~hypothesis.stateful.RuleBasedStateMachine`. * This patch refactors some internals. There is no user- visible change, but we hope to improve performance and unlock support for alternative backends such as :pypi:`symbolic execution with crosshair in future (:issue:`3086`). * This release teaches :func:`~hypothesis.strategies.from_type` to handle constraints implied by the :pypi:`annotated-types` package - as used by e.g. :pypi:`Pydantic`. * This patch adds a warning when :func:`@st.composite wraps a function annotated as returning a :class:`~hypothesis.strategies.SearchStrategy`, since this is usually an error (:issue:`3786`). * This patch refactors ``from_type(typing.Tuple)``, allowing :func:`~hypothesis.strategies.register_type_strategy` to take effect for tuples instead of being silently ignored OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=179
2023-12-27 10:15:20 +00:00
# requires a git checkout
donttest+=" or test_observability"
if [ $(getconf LONG_BIT) -eq 32 ]; then
donttest+=" or test_gets_right_dtype_for_empty_indices"
fi
# suddenly does not raise InvalidArgument with Numpy 2
donttest+=" or test_unrepresentable_elements_are_deprecated"
# we're disabling the healthcheck below, obs is too flaky with it
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
donttest+=" or fails_health_check or slow_tests or on_healthcheck or a_health_check or test_health_check_too_slow"
# and we are overriding the default deadline as well
donttest+=" or test_backend_deadline_exceeded_raised_as_flaky_backend_failure or test_deadline_exceeded_can_be_raised_after_threads"
# flaky tests
donttest+=" or test_has_string_of_max_length or test_database_listener_directory"
- Update to 6.138.13 * text() now occasionally generates from a preselected list of strings which are likely to find bugs. * Improves input validation for several strategies in our pandas extra, so that they raise a helpful InvalidArgument rather than OverflowError. * New "hypothesis-urandom" backend, which draws randomness from /dev/urandom instead of Python’s PRNG. * randoms() no longer produces 1.0, matching the exclusive upper bound of random.Random.random * Nesting @given inside of @given is now a HealthCheck failure. * Add is_hypothesis_test(), for third-party libraries which want to determine whether a test has been defined with Hypothesis. * Add on_observation() to the internal alternative backends interface. * New hypothesis.extra.django.SimpleTestCase * New run_conformance_test(), for use in testing implementations of alternative backends. * Fixes a substantial performance regression in stateful tests from computing string representations, present since version 6.131.20. * Improves the thread safety of many functions and decorators. * Before this release, Hypothesis did not require that super().__init__() be called in SearchStrategy subclasses. Subclassing SearchStrategy is not supported or part of the public API, but if you are subclassing it anyway, you will need to make sure to call super().__init__(). * When a failure found by an alternative backend does not reproduce under the Hypothesis backend, we now raise FlakyBackendFailure. * When a test is executed concurrently from multiple threads, DeadlineExceeded is now disabled. * Add specified callback methods to the observability interface. The previous TESTCASE_CALLBACKS is deprecated. * Add support for Python 3.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=216
2025-09-02 13:08:58 +00:00
# drop tests testing functionality we don't have
rm tests/crosshair/test_crosshair.py
# adapted from pytest.ini in github repo toplevel dir (above hypothesis-python)
echo '[pytest]
addopts=
-rfE
--strict-markers
--tb=native
-p pytester
--runpytest=subprocess
--hypothesis-profile=obs
-v
-n auto
Accepting request 1116915 from home:mimi_vx:branches:devel:languages:python - Update to 6.87.3 * This patch ensures that the :ref:`hypothesis codemod <codemods>` CLI will print a warning instead of stopping with an internal error if one of your files contains invalid syntax (:issue:`3759`). * This patch makes some small changes to our NumPy integration to ensure forward compatibility. * Fixes :issue:`3755`, where an internal condition turns out to be reachable after all. * This release deprecates use of :func:`~hypothesis.assume` and reject() outside of property-based tests, because these functions work by raising a special exception (:issue:`3743`). It also fixes some type annotations (:issue:`3753`). * Hotfix for :issue:`3747`, a bug in explain mode which is so rare that we missed it in six months of dogfooding. Thanks to :pypi:`mygrad` for discovering and promptly reporting this! * This patch improves the documentation of :obj:`@example(...).xfail() <hypothesis.example.xfail>` by adding a note about PEP 614, similar to :obj:`@example(...).via() <hypothesis.example.via>`, and adds a warning when a strategy generates a test case which seems identical to one provided by an xfailed example. * This release enables the :obj:`~hypothesis.Phase.explain` :ref:`phase <phases>` by default. We hope it helps you to understand why your failing tests have failed! * This patch switches some of our type annotations to use :obj:`typing.Literal` when only a few specific values are allowed, such as UUID or IP address versions. * This release deprecates the old whitelist/blacklist arguments to :func:`~hypothesis.strategies.characters`, in favor of include/exclude arguments which more clearly describe their effects on the set of characters which can be generated. OBS-URL: https://build.opensuse.org/request/show/1116915 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=174
2023-10-11 12:12:14 +00:00
--durations-min=1.0
xfail_strict = False
filterwarnings =
# error <-- disabled for obs packaging
ignore::hypothesis.errors.NonInteractiveExampleWarning
Accepting request 982468 from home:bnavigator:branches:devel:languages:python - Update to 6.47.1 * Our pretty-printer no longer sorts dictionary keys, since iteration order is stable in Python 3.7+ and this can affect reproducing examples (issue #3370). This PR was kindly supported by Ordina Pythoneers. - Release 6.47.0 * The Ghostwritter can now write tests for @classmethod or @staticmethod methods, in addition to the existing support for functions and other callables (issue #3318). Thanks to Cheuk Ting Ho for the patch. - Release 6.46.11 * Mention hypothesis.strategies.timezones() in the documentation of hypothesis.strategies.datetimes() for completeness. * Thanks to George Macon for this addition. - Release 6.46.10 * This release contains some small improvements to our documentation. Thanks to Felix Divo for his contribution! - Release 6.46.9 * This patch by Adrian Garcia Badaracco adds type annotations to some private internals (issue #3074). - Release 6.46.8 * This patch by Phillip Schanely makes changes to the floats() strategy when min_value or max_value is present. Hypothesis will now be capable of generating every representable value in the bounds. You may notice that hypothesis is more likely to test values near boundaries, and values that are very close to zero. * These changes also support future integrations with symbolic execution tools and fuzzers (issue #3086). - Release 6.46.7 OBS-URL: https://build.opensuse.org/request/show/982468 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=152
2022-06-14 07:39:05 +00:00
# https://github.com/pandas-dev/pandas/issues/41199
default:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning
default:distutils Version classes are deprecated\. Use packaging\.version instead:DeprecationWarning
# https://github.com/pandas-dev/pandas/issues/32056 (?)
default:numpy\.ufunc size changed, may indicate binary incompatibility\. Expected 216 from C header, got 232 from PyObject:RuntimeWarning
# https://github.com/pandas-dev/pandas/issues/34848
default:`np\.bool` is a deprecated alias for the builtin `bool`:DeprecationWarning
default:`np\.complex` is a deprecated alias for the builtin `complex`:DeprecationWarning
default:`np\.object` is a deprecated alias for the builtin `object`:DeprecationWarning
' > pytest.ini
# increase test deadline for slow obs executions
echo "
import hypothesis
hypothesis.settings.register_profile(
'obs',
deadline=5000,
suppress_health_check=[
hypothesis.HealthCheck.too_slow,
]
)
" >> tests/conftest.py
%if %{without complete_tests}
export PYTEST_ADDOPTS="--ignore=tests/pandas/ --ignore=tests/redis/test_redis_exampledatabase.py"
%endif
%pytest -c pytest.ini -k "not ($donttest)" tests; rm -rf .pytest_cache
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE.txt
%doc README.md
%python_alternative %{_bindir}/hypothesis
%{python_sitelib}/hypothesis
%{python_sitelib}/_hypothesis*.py
%{python_sitelib}/hypothesis-%{version}.dist-info
%pycache_only %{python_sitelib}/__pycache__/*hypothesis*
%endif
%changelog