On Fri, Jul 20, 2007 at 09:48:52AM +0200, Adam Groszer wrote: > Hello, > > In z.a.apidoc.browser.README.txt I can write > """ > >>> browser.open('http://localhost/++apidoc++/non-existent/') > Traceback (most recent call last): > ... > httperror_seek_wrapper: HTTP Error 404: Not Found > """ > (test passes) > > but I can't write > """ > >>> browser.open('http://localhost/++apidoc++/non-existent/') > Traceback (most recent call last): > ... > ...HTTP Error 404: Not Found > """ > it throws: > """ > Failed example: > browser.open('http://localhost/++apidoc++/non-existent/') > Exception raised: > Traceback (most recent call last): > File "U:\zope\svn_zope34\src\zope\testing\doctest.py", line 1348, in > __run > > compileflags, 1) in test.globs > File "<doctest README.txt[3]>", line 1, in ? > browser.open('http://localhost/++apidoc++/non-existent/') > File "U:\zope\svn_zope34\src\zope\testbrowser\browser.py", line 224, in > open > self.mech_browser.open(url, data) > File "U:\zope\svn_zope34\src\mechanize\_mechanize.py", line 203, in open > return self._mech_open(url, data) > File "U:\zope\svn_zope34\src\mechanize\_mechanize.py", line 254, in > _mech_open > raise response > httperror_seek_wrapper: HTTP Error 404: Not Found > """ > > what do I miss?
doctests have special rules for exceptions that are different from the rules of normal output matching. If a statement raises an exception, the output part must be of the form Traceback (most recent call last): ... <exception type>: <exception value> You can use ellipsis in the exception value part, IIRC. Marius Gedminas -- HOST SYSTEM NOT RESPONDING, PROBABLY DOWN. DO YOU WANT TO WAIT? (Y/N)
signature.asc
Description: Digital signature
_______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com