jab / MiniMock (http://pypi.python.org/pypi/MiniMock)

The simplest possible Python mock library.

Clone this repository (size: 52.1 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/jab/minimock/

Changed (Δ296 bytes):

raw changeset »

docs/index.rst (10 lines added, 4 lines removed)

Up to file-list docs/index.rst:

@@ -89,14 +89,20 @@ start with ``mock_``, while the construc
89
89
    essence, this function will be the *real* implementation of the
90
90
    method.
91
91
92
``mock_raises``:
92
``raises``:
93
93
    An exception (instance or class) that will be raised when this
94
94
    object is called.
95
95
96
``tracker``:
97
    An object which is notified every time the mock object is called or
98
    an attribute is set on it (assuming ``show_attrs`` is ``True``);
99
    defaults to a ``Printer`` to stdout. ``TraceTracker`` can instead be
100
    useful for non-doctest tests. Pass ``None`` to disable this behavior.
101
96
102
``show_attrs``:
97
    If this is true, everytime a new attribute is set on the mock
98
    object something will be printed.  Otherwise attribute sets are
99
    silent, and only function calls print something.
103
    If this is true, every time a new attribute is set on the mock
104
    object the tracker will be notified. Otherwise attribute sets are
105
    silent, and only calls trigger notification.
100
106
101
107
So to create an object that always raises ValueError, do::
102
108