Show More
@@ -27,16 +27,12 b' tests for that subpackage should be skipped if the dependencies are not found.' | |||||
27 | This is very important so users don't get tests failing simply because they |
|
27 | This is very important so users don't get tests failing simply because they | |
28 | don't have dependencies. |
|
28 | don't have dependencies. | |
29 |
|
29 | |||
30 |
The testing system we use is a |
|
30 | The testing system we use is an extension of the nose_ test runner. | |
31 | We use both because nose detects more things than Twisted and allows for more |
|
31 | In particular we've | |
32 | flexible (and lighter-weight) ways of writing tests; in particular we've |
|
|||
33 | developed a nose plugin that allows us to paste verbatim IPython sessions and |
|
32 | developed a nose plugin that allows us to paste verbatim IPython sessions and | |
34 |
test them as doctests, which is extremely important for us. |
|
33 | test them as doctests, which is extremely important for us. | |
35 | IPython that depend on Twisted must be tested using trial, because only trial |
|
|||
36 | manages the Twisted reactor correctly. |
|
|||
37 |
|
34 | |||
38 | .. _nose: http://code.google.com/p/python-nose |
|
35 | .. _nose: http://code.google.com/p/python-nose | |
39 | .. _trial: http://twistedmatrix.com/trac/wiki/TwistedTrial |
|
|||
40 |
|
36 | |||
41 |
|
37 | |||
42 | For the impatient: running the tests |
|
38 | For the impatient: running the tests | |
@@ -132,13 +128,6 b' When developing, the :option:`--pdb` and :option:`--pdb-failures` of nose are' | |||||
132 | particularly useful, these drop you into an interactive pdb session at the |
|
128 | particularly useful, these drop you into an interactive pdb session at the | |
133 | point of the error or failure respectively. |
|
129 | point of the error or failure respectively. | |
134 |
|
130 | |||
135 | To run Twisted-using tests, use the :command:`trial` command on a per file or |
|
|||
136 | package basis: |
|
|||
137 |
|
||||
138 | .. code-block:: bash |
|
|||
139 |
|
||||
140 | trial IPython.kernel |
|
|||
141 |
|
||||
142 | .. note:: |
|
131 | .. note:: | |
143 |
|
132 | |||
144 | The system information summary printed above is accessible from the top |
|
133 | The system information summary printed above is accessible from the top | |
@@ -317,20 +306,6 b' problem at hand, since both work)::' | |||||
317 | yield is_smaller(x, y) |
|
306 | yield is_smaller(x, y) | |
318 |
|
307 | |||
319 |
|
308 | |||
320 | Writing tests for Twisted-using code |
|
|||
321 | ------------------------------------ |
|
|||
322 |
|
||||
323 | Tests of Twisted [Twisted]_ using code should be written by subclassing the |
|
|||
324 | ``TestCase`` class that comes with ``twisted.trial.unittest``. Furthermore, all |
|
|||
325 | :class:`Deferred` instances that are created in the test must be properly |
|
|||
326 | chained and the final one *must* be the return value of the test method. |
|
|||
327 |
|
||||
328 | .. note:: |
|
|||
329 |
|
||||
330 | The best place to see how to use the testing tools, are the tests for these |
|
|||
331 | tools themselves, which live in :mod:`IPython.testing.tests`. |
|
|||
332 |
|
||||
333 |
|
||||
334 | Design requirements |
|
309 | Design requirements | |
335 | =================== |
|
310 | =================== | |
336 |
|
311 |
General Comments 0
You need to be logged in to leave comments.
Login now