[Zope-dev] bug in zope.testing 3.7.1?

Chris Withers chris at simplistix.co.uk
Fri Jan 9 06:24:12 EST 2009


Benji York wrote:
> On Fri, Dec 19, 2008 at 1:03 PM, Chris Withers <chris at 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.

Nope, typo on my part, I meant like 386/387:

     if path.startswith('/'):
         raise ValueError('Module-relative files may not have absolute

...which, as I said, runs fine on Windows (which makes me think that 
whole ValueError raise is bogus) and yet fails on Linux.


> 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)

Not quite, that'll actually give you a syntax error ;-)

Here's what I ended up with:

def test_suite():
     return DocFileSuite(
         optionflags=REPORT_NDIFF|ELLIPSIS,
         *glob(join(dirname(__file__),pardir,'docs','*.txt'))
         )

FWIW, I still think the check and raise that I meant to refer to are 
pointless and buggy.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list