[Zope3-dev] help with doctests

2007-07-20 Thread Adam Groszer
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/++api

AW: [Zope3-dev] help with doctests

2007-07-20 Thread Roger Ineichen
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

Re: AW: [Zope3-dev] help with doctests

2007-07-20 Thread Adam Groszer
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 """ >>

[Zope3-dev] doctest prb again

2007-07-20 Thread Adam Groszer
Hello, How to solve the \r\n and \n mismatch between win32 and *nix in the doctests? doctest is: """ >>> ctrl.value 'Text inside\narea!\n ' """ fails with (on win32): """ Failed example: ctrl.value Expected: 'Text inside\narea!\n ' Got:

Re: [Zope3-dev] doctest prb again

2007-07-20 Thread Stefan H. Holek
Doesn't NORMALIZE_WHITESPACE help here? Stefan On 20. Jul 2007, at 10:09, Adam Groszer wrote: How to solve the \r\n and \n mismatch between win32 and *nix in the doctests? -- Anything that happens, happens. --Douglas Adams ___ Zope3-dev mailing

Re[2]: [Zope3-dev] doctest prb again

2007-07-20 Thread Adam Groszer
Hello Stefan, It seems to be already enabled: flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS readme = FunctionalDocFileSuite('README.txt', optionflags=flags, checker=checker) Friday, July 20, 2007, 10:18:30 AM, you wrote: > Doesn't NORMALIZE_WHITESPACE help here? > Ste

Re: [Zope3-dev] doctest prb again

2007-07-20 Thread Marius Gedminas
On Fri, Jul 20, 2007 at 10:09:18AM +0200, Adam Groszer wrote: > Hello, > > How to solve the \r\n and \n mismatch between win32 and *nix in the > doctests? > > doctest is: > """ > >>> ctrl.value > 'Text inside\narea!\n ' > """ > > fails with (on win32): > """ > Failed

Re[2]: [Zope3-dev] doctest prb again

2007-07-20 Thread Adam Groszer
Hello Marius, Great, that works ;-) Thought that there is some more genreic-sane way. Friday, July 20, 2007, 10:25:02 AM, you wrote: > On Fri, Jul 20, 2007 at 10:09:18AM +0200, Adam Groszer wrote: >> Hello, >> >> How to solve the \r\n and \n mismatch between win32 and *nix in the >> doctests? >

Re: [Zope3-dev] help with doctests

2007-07-20 Thread Marius Gedminas
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 > """

[Zope3-dev] Re: help with doctests

2007-07-20 Thread Philipp von Weitershausen
Marius Gedminas wrote: 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 p

[Zope3-dev] Re: doctest prb again

2007-07-20 Thread Philipp von Weitershausen
Adam Groszer wrote: Great, that works ;-) Thought that there is some more genreic-sane way. There is. NORMALIZE_WHITESPACE actually only helps when whatever you're outputting actually prints whitespace. Doing this:: >>> ' ' ' ' won't invoke the whitespace normalizer. Doing this::

Re: [Zope3-dev] Re: help with doctests

2007-07-20 Thread Adam Groszer
Hello Philipp, Great, that would solve also the \r\n substitution also (I hope). Friday, July 20, 2007, 11:27:52 AM, you wrote: > Marius Gedminas wrote: >> doctests have special rules for exceptions that are different from the >> rules of normal output matching. >> >> If a statement raises an e

Re: [Zope3-dev] Re: help with doctests

2007-07-20 Thread Benji York
Philipp von Weitershausen wrote: Sometimes, using ellipses are fine, but generally they obfuscate the doctest when you're reading it. I suggesting using the regex-normalizer [1]. +1 -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-dev

Re: [Zope3-dev] Re: help with doctests

2007-07-20 Thread Jim Fulton
On Jul 20, 2007, at 5:27 AM, Philipp von Weitershausen wrote: Marius Gedminas wrote: 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 cal

Re: [Zope3-dev] Re: help with doctests

2007-07-20 Thread Marius Gedminas
On Fri, Jul 20, 2007 at 07:57:12AM -0400, Jim Fulton wrote: > On Jul 20, 2007, at 5:27 AM, Philipp von Weitershausen wrote: > >I suggesting using the regex-normalizer [1]. There are many > >packages out there that use it if you're looking for examples. > > > >http://svn.zope.org/zope.testing/trun

[Zope3-dev] Re: doctest prb again

2007-07-20 Thread Marius Gedminas
On Fri, Jul 20, 2007 at 11:30:08AM +0200, Philipp von Weitershausen wrote: > Adam Groszer wrote: > >Great, that works ;-) > >Thought that there is some more genreic-sane way. > > There is. NORMALIZE_WHITESPACE actually only helps when whatever you're > outputting actually prints whitespace. Doing