File: intro.rst

package info (click to toggle)
python-sure 2.0.1%2Bgit.2023.02.06.3aef950b7c-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 764 kB
  • sloc: python: 3,517; makefile: 255; sh: 12
file content (24 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Introduction
============

Sure is a python library for python that leverages a DSL for writing
assertions created by `Gabriel Falcão <https://github.com/gabrielfalcao>`_.

In CPython it monkey-patches the ``object`` type, adding some methods
and properties purely for test purposes.

Any python code writen after ``import sure`` gains testing superpowers,
so you can write assertions like this:

.. code:: python

    import sure


    def some_bratty_function(parameter):
        raise ValueError("Me no likey {0}".format(parameter))


    some_bratty_function.when.called_with("Scooby").should.throw(ValueError, "Me no likey Scooby")

Let's `get it started <getting-started.html>`__