/usr/share/pyshared/zope/testing/doctest.txt is in python-zope.testing 3.10.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ========================
Additional doctest Tests
========================
Most `doctest` module tests are located within the module. This file only
tests a few additional features not covered by the module tests, so that the
changes to the `doctest` module -- which is forked from the Python standard
library -- are minimized.
Working with Carriage Returns
-----------------------------
Due to the way releases are made on different platforms, we sometimes test
files on a *nix system with Windows file endings. Unfortunately, that leaves
some of the test files broken:
>>> import tempfile
>>> fn = tempfile.mktemp()
>>> open(fn, 'w').write('Test:\r\n\r\n >>> x = 1 + 1\r\n\r\nDone.\r\n')
Let's now run it as a doctest:
>>> from zope.testing import doctest
>>> doctest.testfile(fn, False)
(0, 1)
It worked. Let's also try the test file suite:
>>> import unittest
>>> result = unittest.TestResult()
>>> doctest.DocFileSuite(fn, module_relative=False).run(result) #doctest: +ELLIPSIS
<...TestResult run=1 errors=0 failures=0>
Regression tests
----------------
This section is about regression tests of ``zope.testing`` itself.
>>> from zope.testing.doctest import *
LP #69988 and #144569 both assert that doctests fail when rendering
non-ASCII output with a UnicodeDecodeError. However, this does not appear
to be so:
>>> print u'abc'
abc
>>> print u'\xe9'.encode('utf-8')
é
Tests for LP #561568:
>>> v = u'foo\xe9bar'
>>> v # doctest: +ELLIPSIS
u'foo...bar'
>>> v.encode('utf-8') # doctest: +ELLIPSIS
'foo...bar'
|