Re: [Zope3-dev] help with doctests
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 "", 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): ... : 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
Re: AW: [Zope3-dev] help with doctests
Hi Roger! Yes, it's the same :-( Friday, July 20, 2007, 9:59:48 AM, you wrote: RI> Hi Adam >> Auftrag von Adam Groszer >> Gesendet: Freitag, 20. Juli 2007 09:49 >> An: zope3-dev >> Betreff: [Zope3-dev] help with doctests >> >> 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 RI> Did you try: RI> ...HTTP Error 404: Not Found... RI> Regards RI> Roger Ineichen RI> _ RI> END OF MESSAGE ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
AW: [Zope3-dev] help with doctests
Hi Adam > Auftrag von Adam Groszer > Gesendet: Freitag, 20. Juli 2007 09:49 > An: zope3-dev > Betreff: [Zope3-dev] help with doctests > > 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 Did you try: ...HTTP Error 404: Not Found... Regards Roger Ineichen _ END OF MESSAGE ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] help with doctests
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 "", 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? -- Best regards, Adam mailto:[EMAIL PROTECTED] ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com