@@ -112,7 +112,7 @@ test suite runs.
112112
113113A simple doctest in a function:
114114
115- ::
115+ .. code-block :: python
116116
117117 def square (x ):
118118 """ Squares x.
@@ -142,15 +142,15 @@ py.test
142142
143143py.test is a no-boilerplate alternative to Python's standard unittest module.
144144
145- ::
145+ .. code-block :: console
146146
147147 $ pip install pytest
148148
149149 Despite being a fully-featured and extensible test tool, it boasts a simple
150150syntax. Creating a test suite is as easy as writing a module with a couple of
151151functions
152152
153- ::
153+ .. code-block :: console
154154
155155 # content of test_sample.py
156156 def func(x):
@@ -161,7 +161,7 @@ functions
161161
162162 and then running the `py.test ` command
163163
164- ::
164+ .. code-block :: console
165165
166166 $ py.test
167167 =========================== test session starts ============================
193193nose extends unittest to make testing easier.
194194
195195
196- ::
196+ .. code-block :: console
197197
198198 $ pip install nose
199199
210210tox is a tool for automating test environment management and testing against
211211multiple interpreter configurations
212212
213- ::
213+ .. code-block :: console
214214
215215 $ pip install tox
216216
@@ -227,14 +227,14 @@ API and better assertions over the one available in previous versions of Python.
227227
228228If you're using Python 2.6 or below, you can install it with pip
229229
230- ::
230+ .. code-block :: console
231231
232232 $ pip install unittest2
233233
234234 You may want to import the module under the name unittest to make porting code
235235to newer versions of the module easier in the future
236236
237- ::
237+ .. code-block :: python
238238
239239 import unittest2 as unittest
240240
253253
254254mock is a library for testing in Python.
255255
256- ::
256+ .. code-block :: console
257257
258258 $ pip install mock
259259
@@ -262,7 +262,7 @@ make assertions about how they have been used.
262262
263263For example, you can monkey patch a method
264264
265- ::
265+ .. code-block :: console
266266
267267 from mock import MagicMock
268268 thing = ProductionClass()
@@ -275,7 +275,7 @@ To mock classes or objects in a module under test, use the ``patch`` decorator.
275275In the example below, an external search system is replaced with a mock that
276276always returns the same result (but only for the duration of the test).
277277
278- ::
278+ .. code-block :: console
279279
280280 def mock_search(self):
281281 class MockSearchQuerySet(SearchQuerySet):
0 commit comments