Skip to main content

surer

.. image:: https://img.shields.io/pypi/dm/surer :target: https://pypi.org/project/surer

.. image:: https://github.com/getmoto/surer/workflows/Sure%20Tests/badge.svg :target: https://github.com/getmoto/surer/actions?query=workflow%3A%22Sure+Tests%22

.. image:: https://img.shields.io/readthedocs/sure :target: https://surer.readthedocs.io/

.. image:: https://img.shields.io/github/license/getmoto/surer?label=Github%20License :target: https://github.com/getmoto/surer/blob/master/LICENSE

.. image:: https://img.shields.io/pypi/v/surer :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/l/surer?label=PyPi%20License :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/format/surer :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/status/surer :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/pyversions/surer :target: https://pypi.org/project/surer

.. image:: https://img.shields.io/pypi/implementation/surer :target: https://pypi.org/project/surer

An idiomatic testing library for python with powerful and flexible assertions, created by Gabriel Falcão <https://github.com/gabrielfalcao>. Sure's developer experience is inspired and modeled after RSpec Expectations <http://rspec.info/documentation/3.5/rspec-expectations/> and should.js <https://github.com/shouldjs/should.js>_.

.. note::

This is a fork of Gabriel's library, maintained at `http://github.com/getmoto/surer`. It provides support for more recent Python-versions, but does not differ in functionality.

Installing

.. code:: bash

$ pip install sure

Documentation

Available in the website <https://surer.readthedocs.io/en/latest/>__ or under the docs directory.

You can also build the documentation locally using sphinx:

.. code:: bash

make docs

Here is a tease

Equality


(number).should.equal(number)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

    import sure

    (4).should.be.equal(2 + 2)
    (7.5).should.eql(3.5 + 4)

    (3).shouldnt.be.equal(5)

Assert dictionary and its contents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

    {'foo': 'bar'}.should.equal({'foo': 'bar'})
    {'foo': 'bar'}.should.have.key('foo').which.should.equal('bar')

"A string".lower().should.equal("a string") also works
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: python

    "Awesome ASSERTIONS".lower().split().should.equal(['awesome', 'assertions'])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surer-0.0.2.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

surer-0.0.2-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file surer-0.0.2.tar.gz.

File metadata

  • Download URL: surer-0.0.2.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for surer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ec1040e3ac6cf2de1062c39fa790f529da7e38a63a37371c5d6d00b0c5af2363
MD5 65b9d2db16ab202c793fe87c77f14e67
BLAKE2b-256 53fad5fa93b75e391d0d06cc4125107a73dd04eaeeb6e59629468dff4a22e0d6

See more details on using hashes here.

File details

Details for the file surer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: surer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for surer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 deff806348786afccc3febd9a93dc6ab7c41b21ba607256e10f414e041d53a45
MD5 19ec0b1163c3f89ff58a1cf8d3a3a727
BLAKE2b-256 39c70cff4b4670fcfa0c82949f96b4732afdc8134fbc37921e81686aa87a6395

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page