nose-devs/nose — Issue #189: Improve display and selectability of doctest examples
Author: jpellerin
Created: 2011-12-14 16:03:15+00:00
State: open

Suggestion from Michal Kwiatkowski on the TIP list:

>>>
For example:

def answer():
"""
Returns 42 by default.
>>> answer()
42

Returns 7 for 6.
>>> answer(6)
7
"""
pass

will yield:

doctest:answer():"Returns 42 by default."
doctest:answer():"Returns 7 for 6."
<<<

My addition: extend this to include an example index in the name, and allow
use of the example index to run just that example:

doctest:answer()[example 1]:"Returns 42 by default."

nosetests module:answer[example 1]

or, if 0.10 test addressing changes:

nosetests module.answer[example 1]

This may require providing plugins with hooks to decode test names.

Google Code Info:
Issue #: 37
Author: jpelle...@gmail.com
Created On: 2007-03-05T23:00:48.000Z
Closed On: