Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-27 Thread Charlie Clark
Am 17.04.2010, 03:41 Uhr, schrieb Tres Seaver : > The trickier testing bits we would re-write as super thorough, no > shortcuts-taken unit tests: one testcase class per class (or API > function) under test, at least one method per class-under-test method, > with more preferred to get all code pat

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-22 Thread Charlie Clark
Am 22.04.2010, 05:48 Uhr, schrieb Christian Theune : >> Could get a lint "template" (or whatever it's called) to help here? > Not sure what that means, can you elaborate a bit? Lint is a tool that analyses code for all kinds of languages, including Python, and scores it against various definabl

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-21 Thread Christian Theune
On 04/21/2010 09:05 PM, Charlie Clark wrote: > Am 20.04.2010, 18:43 Uhr, schrieb Christian Theune: > >> Let me raise another issue which is that we also need to figure out how >> to follow up with this once we start. > > Could get a lint "template" (or whatever it's called) to help here? Not sure

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-21 Thread Charlie Clark
Am 20.04.2010, 18:43 Uhr, schrieb Christian Theune : > Let me raise another issue which is that we also need to figure out how > to follow up with this once we start. Could get a lint "template" (or whatever it's called) to help here? Charlie -- Charlie Clark Managing Director Clark Consulting

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-20 Thread Christian Theune
On 04/17/2010 03:41 AM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This kind of goes with Lennart's frustration about trying to port the > ZTK packages, or a core subset, to Python 3. > > I would like to see the ZTK packages have really excellent > documentation, as we

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-20 Thread Christian Theune
On 04/19/2010 04:06 PM, Lennart Regebro wrote: > On Mon, Apr 19, 2010 at 16:03, Lennart Regebro wrote: >> On Mon, Apr 19, 2010 at 15:48, Marius Gedminas wrote: >>> If you've the discipline to keep the doctests short, I don't see why you >>> shouldn't continue writing them instead of unit tests >>

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-20 Thread Christian Theune
On 04/19/2010 03:56 PM, Wichert Akkerman wrote: > On 4/19/10 15:48 , Marius Gedminas wrote: >> def doctest_MyClass_bar(): >> """Test MyClass.bar >> >> >>> y = MyClass() >> >>The bar method peforms a bar calculation that typically returns >>twe

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-20 Thread Christian Theune
On 04/17/2010 10:56 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Lennart Regebro wrote: >> On Sat, Apr 17, 2010 at 19:17, Tres Seaver wrote: >>> I'm ambivalent about testing the Sphinx code snippets on each test run. >>> I want those snippets to be *much* less com

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Jonathan Lange
On Mon, Apr 19, 2010 at 6:42 PM, Marius Gedminas wrote: > On Mon, Apr 19, 2010 at 03:56:02PM +0200, Wichert Akkerman wrote: >> On 4/19/10 15:48 , Marius Gedminas wrote: >> >      def doctest_MyClass_bar(): >> >          """Test MyClass.bar >> > >> >              >>>  y = MyClass() >> > >> >      

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Marius Gedminas
On Mon, Apr 19, 2010 at 03:56:02PM +0200, Wichert Akkerman wrote: > On 4/19/10 15:48 , Marius Gedminas wrote: > > def doctest_MyClass_bar(): > > """Test MyClass.bar > > > > >>> y = MyClass() > > > > The bar method peforms a bar calculation that typically return

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Benji York wrote: > On Mon, Apr 19, 2010 at 7:21 AM, Charlie Clark > wrote: >> Narrative documentation forces you to explain yourself to someone else. >> Neither, however, will necessarily notice if you forget something: tests >> aren't documentation

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam GROSZER wrote: > I'm somewhat vary on unittests. I've seen some damn cryptic ones that > took a lot of time to decipher. > A doctest somehow forces you to dump your mind (well at least that, if > we're not that brilliant techdoc writers). > OTOH

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Jonathan Lange
On Mon, Apr 19, 2010 at 3:03 PM, Lennart Regebro wrote: > On Mon, Apr 19, 2010 at 15:48, Marius Gedminas wrote: >> If you've the discipline to keep the doctests short, I don't see why you >> shouldn't continue writing them instead of unit tests > > Because they are a bitch to debug, relies on det

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Benji York
On Mon, Apr 19, 2010 at 9:48 AM, Marius Gedminas wrote: > On Mon, Apr 19, 2010 at 12:50:23PM +0200, Adam GROSZER wrote: >> >> I'm somewhat vary on unittests. I've seen some damn cryptic ones that >> took a lot of time to decipher. >> A doctest somehow forces you to dump your mind (well at least th

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Lennart Regebro
On Mon, Apr 19, 2010 at 16:03, Lennart Regebro wrote: > On Mon, Apr 19, 2010 at 15:48, Marius Gedminas wrote: >> If you've the discipline to keep the doctests short, I don't see why you >> shouldn't continue writing them instead of unit tests > > Because they are a bitch to debug, relies on detai

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Lennart Regebro
On Mon, Apr 19, 2010 at 15:48, Marius Gedminas wrote: > If you've the discipline to keep the doctests short, I don't see why you > shouldn't continue writing them instead of unit tests Because they are a bitch to debug, relies on details of output, which makes them brittle, hard to port to Python

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Wichert Akkerman
On 4/19/10 15:48 , Marius Gedminas wrote: > def doctest_MyClass_bar(): > """Test MyClass.bar > > >>> y = MyClass() > > The bar method peforms a bar calculation that typically returns > twenty-three: > > >>> y.bar() > 23 > >

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Marius Gedminas
On Mon, Apr 19, 2010 at 12:50:23PM +0200, Adam GROSZER wrote: > Hello Tres, > > Saturday, April 17, 2010, 3:41:02 AM, you wrote: > > TS> -BEGIN PGP SIGNED MESSAGE- > TS> Hash: SHA1 > > > > +lots on more docs > +lots on 100% coverage > > TS> The trickier testing bits we would re-write

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Benji York
On Mon, Apr 19, 2010 at 7:21 AM, Charlie Clark wrote: > Narrative documentation forces you to explain yourself to someone else. > Neither, however, will necessarily notice if you forget something: tests > aren't documentation and docu [sic] Quite true. It is also true that tests should be well d

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Charlie Clark
Am 19.04.2010, 12:50 Uhr, schrieb Adam GROSZER : Before I start: + lots on the general idea. Zope's narrative documentation is attrocious"[1] and we have lost users and developers as a result. > I'm somewhat vary on unittests. I've seen some damn cryptic ones that > took a lot of time to deciph

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-19 Thread Adam GROSZER
Hello Tres, Saturday, April 17, 2010, 3:41:02 AM, you wrote: TS> -BEGIN PGP SIGNED MESSAGE- TS> Hash: SHA1 +lots on more docs +lots on 100% coverage TS> The trickier testing bits we would re-write as super thorough, no TS> shortcuts-taken unit tests: one testcase class per class (or

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-18 Thread Godefroid Chapelle
On 17/04/10 23:20, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jim Fulton wrote: > >> - I can almost guarantee that any examples that aren't tested will be >> wrong. I tried to do a good job on the bobo docs. I made almost all >> of the examples executable, and the

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Martin Aspeli
On 18 April 2010 05:20, Tres Seaver wrote: > I'm not against having the snippets be executable, because I *do* want > them to work.  I just don't want to encourage anyone to think that they > are testing the software when they write the snippets, or execute them. >  Executing the snippets is test

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Chris McDonough
On 4/17/10 5:20 PM, Tres Seaver wrote: > >> - Documentation should be written for documentation's sake. The >> emphasis should be on helping people understand what the software is >> for and how to use it, *not* on coverage. > > Amen. > >> - Documentation should be executable. Manuel helps a lot f

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: > On Fri, Apr 16, 2010 at 9:41 PM, Tres Seaver wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> This kind of goes with Lennart's frustration about trying to port the >> ZTK packages, or a core subset, to Python 3. >>

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Jim Fulton
On Fri, Apr 16, 2010 at 9:41 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This kind of goes with Lennart's frustration about trying to port the > ZTK packages, or a core subset, to Python 3. > > I would like to see the ZTK packages have really excellent > documentat

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lennart Regebro wrote: > On Sat, Apr 17, 2010 at 19:17, Tres Seaver wrote: >> I'm ambivalent about testing the Sphinx code snippets on each test run. >> I want those snippets to be *much* less comprehensive than they are >> currently, and am pretty s

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Lennart Regebro
On Sat, Apr 17, 2010 at 19:17, Tres Seaver wrote: > I'm ambivalent about testing the Sphinx code snippets on each test run. >  I want those snippets to be *much* less comprehensive than they are > currently, and am pretty sure that drift in the non-executable bits is > at least as important a prob

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lennart Regebro wrote: > On Sat, Apr 17, 2010 at 16:05, Laurence Rowe wrote: >> It's important that documentation is tested as part of the standard >> test run, that means when you change something you know to update the >> docs. repoze.bfg seemed to

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Lennart Regebro
On Sat, Apr 17, 2010 at 16:05, Laurence Rowe wrote: > It's important that documentation is tested as part of the standard > test run, that means when you change something you know to update the > docs. repoze.bfg seemed to make an attempt at this, though it is > currently disabled. > http://svn.re

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Laurence Rowe
On 17 April 2010 10:41, Lennart Regebro wrote: > On Sat, Apr 17, 2010 at 11:18, yuppie wrote: >> How can we make sure docs and code don't get out of sync? Do we have to >> run unittests *and* build the docs before each checkin? Will someone >> make sure buildbots and nightly tests report broken d

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Lennart Regebro
On Sat, Apr 17, 2010 at 11:18, yuppie wrote: > How can we make sure docs and code don't get out of sync? Do we have to > run unittests *and* build the docs before each checkin? Will someone > make sure buildbots and nightly tests report broken docs as well? Hm... As long as you use the >>> synta

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread yuppie
Hi! Tres Seaver wrote: > The refactoring I would like to see happen is to move the main narrative > documentation into a separate, Sphinx-driven 'docs' directory in each > ZTK package. As part of this move, we can start adding some of the > really nice Sphinx features (cross references, indexing

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-17 Thread Wichert Akkerman
On 2010-4-17 03:41, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This kind of goes with Lennart's frustration about trying to port the > ZTK packages, or a core subset, to Python 3. > > I would like to see the ZTK packages have really excellent > documentation, as well a

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-16 Thread Lennart Regebro
(Although possible we could call it "developing" instead of "hacking" but that's not a big issue. ;) ) -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64 ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.z

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-16 Thread Lennart Regebro
On Sat, Apr 17, 2010 at 03:41, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This kind of goes with Lennart's frustration about trying to port the > ZTK packages, or a core subset, to Python 3. > > I would like to see the ZTK packages have really excellent > documentatio

Re: [Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-16 Thread Martin Aspeli
On 17 April 2010 09:41, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This kind of goes with Lennart's frustration about trying to port the > ZTK packages, or a core subset, to Python 3. > > I would like to see the ZTK packages have really excellent > documentation, as w

[Zope-dev] RFC: Proposed new style for documenting and testing ZTK packages

2010-04-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This kind of goes with Lennart's frustration about trying to port the ZTK packages, or a core subset, to Python 3. I would like to see the ZTK packages have really excellent documentation, as well as 100% test coverage. I think we need to look at ref