Debian Codegraph @

docs/source/intro.rst

raw
1 Introduction
2 ============
3
4 Sure is a python library for python that leverages a DSL for writing
5 assertions created by `Gabriel Falcão <https://github.com/gabrielfalcao>`_.
6
7 In CPython it monkey-patches the ``object`` type, adding some methods
8 and properties purely for test purposes.
9
10 Any python code writen after ``import sure`` gains testing superpowers,
11 so you can write assertions like this:
12
13 .. code:: python
14
15 import sure
16
17
18 def some_bratty_function(parameter):
19 raise ValueError("Me no likey {0}".format(parameter))
20
21
22 some_bratty_function.when.called_with("Scooby").should.throw(ValueError, "Me no likey Scooby")
23
24 Let's `get it started <getting-started.html>`__