1
========================
2
Additional doctest Tests
3
========================
5
Most `doctest` module tests are located within the module. This file only
6
tests a few additional features not covered by the module tests, so that the
7
changes to the `doctest` module -- which is forked from the Python standard
8
library -- are minimized.
10
Working with Carriage Returns
11
-----------------------------
13
Due to the way releases are made on different platforms, we sometimes test
14
files on a *nix system with Windows file endings. Unfortunately, that leaves
15
some of the test files broken:
18
>>> fn = tempfile.mktemp()
19
>>> open(fn, 'w').write('Test:\r\n\r\n >>> x = 1 + 1\r\n\r\nDone.\r\n')
21
Let's now run it as a doctest:
23
>>> from zope.testing import doctest
24
>>> doctest.testfile(fn, False)
27
It worked. Let's also try the test file suite:
30
>>> result = unittest.TestResult()
31
>>> doctest.DocFileSuite(fn, module_relative=False).run(result)
32
<unittest.TestResult run=1 errors=0 failures=0>