[IPython-dev] All tests pass on windows!

Fernando Perez fperez.net@gmail....
Tue Jun 12 13:29:21 CDT 2012


On Tue, Jun 12, 2012 at 10:48 AM, Thomas Kluyver <takowl@gmail.com> wrote:
> If possible, the recommended way is to write regular tests, because
> doctests are regularly a headache. For things that do need doctests
> with unicode strings in, write the example like '{u}"thestring" ', and
> wrap it in py3compat.u_format() - or apply u_format as a decorator to
> change a function's docstring.

And as a general note (I'd said this to Thomas somewhere on github
already): it's *totally OK* to remove doctests if we replace what they
test with 'normal tests'.  We used a lot more docetsts early on, when
we were trying to bootstrap IPython's testing support from nearly
zero.  The internals of IPython were so messy and hard to cleanly test
in isolation that the easiest way to get started was to hack a doctest
plugin that would recognize copy-pasted IPython sessions from the
terminal and could reproduce them whole.  But now that we're well past
that point, moving forward it's far cleaner to user regular
programmatic tests, and leave interactive sessions to be only used for
their educational value as examples (it's OK if they are also a simple
and easy doctest, but the main point should be that they serve as
useful documentation, not as tests).

Cheers,

f


More information about the IPython-dev mailing list