Expects

Latest version: v0.9.0

Safety actively analyzes 621673 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.9.0

------------------

Highlights
^^^^^^^^^^

* Fix Python 3.7 collections ABC classes deprecation warning. See `GH-55 <https://github.com/jaimegildesagredo/expects/pull/55>`_.
* Hide ``expects`` internals from pytest tracebacks. See `GH-51 <https://github.com/jaimegildesagredo/expects/pull/51>`_.

Backwards-incompatible
^^^^^^^^^^^^^^^^^^^^^^

* Dropped Python 2.6 support.

0.8.0

------------------

Changes since last stable release:

Highlights
^^^^^^^^^^

* New failure messages for matchers. Now its easier to see the reason that caused the assertion failure. For example::

>>> expect([1, {'foo': 1}]).to(contain(have_key('foo', 2)))

AssertionError:
expected: [1, {'foo': 1}] to contain have key 'foo' equal 2
but: item have key 'foo' equal 2 not found

Bug fixes
^^^^^^^^^

* Now the failure message for ``have_key``/``have_keys`` is fixed when composed with another matcher. See `GH-29 <https://github.com/jaimegildesagredo/expects/issues/29>`_.
* Allow ``contain``, ``contain_exactly`` and ``contain_only`` matchers to work with dict views (e.g. ``dict.keys()``). See `GH-42 <https://github.com/jaimegildesagredo/expects/issues/42>`_.
* Allow ``contain``, ``contain_exactly`` and ``contain_only`` matchers to work with sets. See `GH-38 <https://github.com/jaimegildesagredo/expects/issues/38>`_.
* Show traceback in ``raise_error`` when another exception is raised. See `GH-41 <https://github.com/jaimegildesagredo/expects/issues/41>`_.
* The ``equal`` matcher now uses ``__ne__`` for negated assertions. See `GH-40 <https://github.com/jaimegildesagredo/expects/pull/40>`_.
* The ``not_`` matcher now uses the inner matcher ``_match_negated`` method to perform a negated assertion.
* Python 2.6 support.

Backwards-incompatible
^^^^^^^^^^^^^^^^^^^^^^

Although your assertions should still be working (if are broken, just `report an issue <https://github.com/jaimegildesagredo/expects/issues>`_), the *custom matchers* api has been changed. To see an example of how to migrate your custom matchers to the new api you can see `the doublex-expects migration <https://github.com/jaimegildesagredo/doublex-expects/commit/f4908989298fbbaed46b59080d3a619a37f533fa>`_.

* The ``Matcher._match`` method now should return a tuple of ``bool`` representing the result of the matcher and a ``list`` of reasons that explain this result::

def _match(self, subject):
if subject:
return True, ['a reason']
return False, ['another reason']

* The ``Matcher._description`` method was removed. Now, with the change announced above, a matcher description won't need the subject to describe itself, so the ``__repr__`` magic method will be used instead to describe matchers.

* The ``Matcher._match_value`` method was removed. With the new api it made much less sense so it was removed and the ``expects.matchers.default_matcher`` wrapper function was added::

>>> default_matcher(1)._match(2)
False, ['was 1']

0.8.0rc5

---------------------

Bug fixes
^^^^^^^^^

* Allow ``contain``, ``contain_exactly`` and ``contain_only`` matchers to work with dict views (e.g. ``dict.keys()``). See `GH-42 <https://github.com/jaimegildesagredo/expects/issues/42>`_.
* Allow ``contain``, ``contain_exactly`` and ``contain_only`` matchers to work with sets. See `GH-38 <https://github.com/jaimegildesagredo/expects/issues/38>`_.
* Show traceback in ``raise_error`` when another exception is raised. See `GH-41 <https://github.com/jaimegildesagredo/expects/issues/41>`_.

0.8.0rc4

---------------------

Bug fixes
^^^^^^^^^

* Show the correct failure message on negated ``contain_exactly`` and ``contain_only`` matchers. See `GH-33 <https://github.com/jaimegildesagredo/expects/issues/33>`_.

0.8.0rc3

---------------------

Bug fixes
^^^^^^^^^

* The ``equal`` matcher now uses ``__ne__`` for negated assertions. See `GH-40 <https://github.com/jaimegildesagredo/expects/pull/40>`_.
* The ``not_`` matcher now uses the inner matcher ``_match_negated`` method to perform a negated assertion.

0.8.0rc2

---------------------

Bug fixes
^^^^^^^^^

* Python 2.6 support.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.