On Fri, Dec 19, 2008 at 1:03 PM, Chris Withers <ch...@simplistix.co.uk> wrote:
> Hi Guys,
> Line 396 of doctest.py contains code which is, at best,
> platform-specific (and so a bug) or, more likely, irrelevent.

Line 396 of doctest.py from zope.testing 3.7.1 doesn't include a raise.  I'm
assuming you mean line 401 instead.

> I have the following code that runs the tests in all my package's docs:
> def test_suite():
>     suite = unittest.TestSuite()
>     for path in \
>      glob(os.path.join(os.path.dirname(__file__),'..','docs','*.txt')):
>         suite.addTest(
>             DocFileSuite(path, optionflags=REPORT_NDIFF|ELLIPSIS)
>             )
>     return suite

Paths to doctest files are relative to the calling module (by default).

Also, DocFileSuite can take multiple paths, so your function can be
simplified to this:

def test_suite():
    paths = glob(os.path.join('..', 'docs', '*.txt'))
    return DocFileSuite(*paths, optionflags=REPORT_NDIFF|ELLIPSIS)

(You might want to use os.path.pardir instead of '..')
Benji York
Senior Software Engineer
Zope Corporation
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to