Expects

Latest version: v0.9.0

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

Scan your dependencies

Page 3 of 4

0.5.0

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

Highlights
^^^^^^^^^^

* Now the ``&`` and ``|`` operators can be used to write simpler assertions::

expect('Foo').to(have_length(3) & start_with('F'))
expect('Foo').to(equal('Foo') | equal('Bar'))

* The ``testing.failure`` context manager can be used even without calling it with the failure message as argument::

with failure:
expect('foo').to(be_empty)

* Also can receive matchers as argument::

with failure(end_with('empty')):
expect('foo').to(be_empty)

.. note:: See also backwards-incompatible changes for ``testing.failure``.

* Added the ``be_callable`` matcher.
* Published a list of `3rd Party Matchers libraries <http://expects.readthedocs.org/en/latest/3rd-party-matchers.html>`_.


Bug fixes
^^^^^^^^^

* The ``be_within`` matcher now supports float values.
* In some places ``bytes`` were not being treated as a string type in python 3.

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

* The ``match`` matcher now passes if matches a part of the subject string instead of all of it. Previously used the :func:`re.match` and now uses :func:`re.search`. If your tests depended on this you can migrate them by adding a ``'^'`` and ``'$'`` at the beginning and end of your regular expression.
* The ``testing.failure`` context manager not longer tries to match regular expressions. Instead you can pass the ``match`` matcher with your regexp.

0.4.2

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

Highlights
^^^^^^^^^^

* Added the ``not_`` matcher to negate another matcher when composing matchers.

0.4.1

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

Bug fixes
^^^^^^^^^

* Now ``from expects import *`` only imports the ``expect`` callable and *built in* matchers.

0.4.0

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

Warnings
^^^^^^^^

This release *does not* maintain backwards compatibility with the previous version because a *new syntax was implemented* based on matchers. Matchers have been implemented maintaining compatibility with its equivalent assertions (and those that break compatibility are listed below). For most users upgrade to this version will only involve a migration to the new syntax.

Highlights
^^^^^^^^^^

* Improved failure message for ``have_keys`` and ``have_properties`` matchers.
* The ``raise_error`` matcher now can receive any other matcher as the second argument.

Bug fixes
^^^^^^^^^

* The ``have_key`` and ``have_keys`` always fail if the subject is not a dict.
* Fixed ``contain`` matcher behavior when negated. See `this commit <https://github.com/jaimegildesagredo/expects/commit/b240f14256c72fb1c53619ce19392bb28da77d88>`_.

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

* The ``end_with`` matcher should receive args in the right order and not reversed. See `this commit <https://github.com/jaimegildesagredo/expects/commit/3be83da4e0c335efa02931e19b30233e1021fec3>`_.
* The ``to.have`` and ``to.have.only`` assertions have been remamed to ``contain`` and ``contain_exactly`` matchers.
* Assertion chaining has been replaced by *matcher composition* in all places where was possible in the previous version.
* The ``testing.failure`` context manager now only receives a string matching the failure message.

0.3.0

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

Highlights
^^^^^^^^^^

* The `start_with <http://expects.readthedocs.org/en/v0.3.0/reference.htmlstart-with>`_ and `end_with <http://expects.readthedocs.org/en/v0.3.0/reference.htmlend-with>`_ assertions now support lists, iterators and ordered dicts. `GH-16 <https://github.com/jaimegildesagredo/expects/issues/16>`_.

Bug fixes
^^^^^^^^^

* Fixes a regression in the ``raise_error`` assertion introduced in v0.2.2 which caused some tests to fail. See `GH-17 <https://github.com/jaimegildesagredo/expects/issues/17>`_ for more info.

0.2.3

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

Highlights
^^^^^^^^^^

* Added the `start_with <http://expects.readthedocs.org/en/v0.2.3/reference.htmlstart-with>`_ and `end_with <http://expects.readthedocs.org/en/v0.2.3/end-with>`_ assertions. `GH-14 <https://github.com/jaimegildesagredo/expects/issues/14>`_.

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.