Re: [Zope-dev] zope.formlib's action decorator return Action() object, not the decorated function. Why?

2012-09-18 Thread Jan-Wijbrand Kolman
On 9/16/12 07:28 , Marius Gedminas wrote:
 On Fri, Sep 14, 2012 at 01:44:30PM +0200, Jan-Wijbrand Kolman wrote:
 The reason I came across this issue is trying to improve the test
 coverage of the application I'm building somewhat closer to 100% and
 found that the form actions implementation *appeared* not to be covered
 at all - even if there clearly are tests for these.
 
 How are you measuring coverage?

The coverage reports as generated by the zope.testrunner ``--coverage``
option, then z3c.coverage to render the reports into html.

 How are you testing the handlers?

In this specific case, I noticed the handlers seemed not be called
(according to the coverage report) when using a test browser
submitting a form.

But I didn't try anything else just yet except for running that test
again with a patched zope.formlib - where the decorated would return the
function - and then the coverage was up :-)

 I'm asking because I haven't encountered this issue in my projects --
 form action handlers show up in my test coverage just fine.
 
 I tried having the decorator just returning the function, and at least
 all zope.formlib's tests themselves do pass.

 Would anyone mind if I would change the behaviour of the decorator?
 
 I have unit tests that invoke view.handle_foo_button.handler() directly,
 because they assume zope.formlib's @action replaces the
 handle_foo_button method with an Action.  Your change would break my
 tests, but they would be trivial to fix, so my vote would be -0, with
 the request of a larger version bump to indicate backwards-incompatibility.

Ok, clear.

Thanks for the feedback!

regards, jw

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] zope.formlib's action decorator return Action() object, not the decorated function. Why?

2012-09-18 Thread Jan-Wijbrand Kolman
On 9/16/12 09:38 , Wichert Akkerman wrote:
 On Sep 16, 2012, at 07:28, Marius Gedminas mar...@gedmin.as wrote:
 
 On Fri, Sep 14, 2012 at 01:44:30PM +0200, Jan-Wijbrand Kolman wrote:
 After years and years of heavily using zope.formlib it suddenly struck
 me that the zope.formlib.form.action decorator returns an Action()
 object instead of the decorated function (this action object is also
 added to the form's actions sequence as a side effect of the decorator).

 I know wonder: Why?

 (I've no clue.)
 
 Another effect of this is probably that you can use sphinx's autodoc for 
 actions which would be unfortunate.

Ah, good catch. Didn't think of that yet...
regards, jw


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zope-tests - FAILED: 4, OK: 20

2012-09-18 Thread Zope tests summarizer
This is the summary for test reports received on the 
zope-tests list between 2012-09-17 00:00:00 UTC and 2012-09-18 00:00:00 UTC:

See the footnotes for test reports of unsuccessful builds.

An up-to date view of the builders is also available in our 
buildbot documentation: 
http://docs.zope.org/zopetoolkit/process/buildbots.html#the-nightly-builds

Reports received


   Successful - zopetoolkit_trunk - Build # 17
   Zope-2.10 Python-2.4.6 : Linux
   Zope-2.11 Python-2.4.6 : Linux
   Zope-2.12 Python-2.6.8 : Linux
   Zope-2.13 Python-2.6.8 : Linux
   Zope-2.13 Python-2.7.3 : Linux
   Zope-trunk Python-2.6.8 : Linux
   Zope-trunk Python-2.7.3 : Linux
   winbot / ZODB_dev py_265_win32
   winbot / ZODB_dev py_265_win64
   winbot / ZODB_dev py_270_win32
   winbot / ZODB_dev py_270_win64
[1]winbot / z3c.contents_py_265_32
[2]winbot / z3c.coverage_py_265_32
[3]winbot / z3c.layer.ready2go_py_265_32
[4]winbot / z3c.recipe.paster_py_265_32
   winbot / ztk_10 py_254_win32
   winbot / ztk_10 py_265_win32
   winbot / ztk_10 py_265_win64
   winbot / ztk_11 py_254_win32
   winbot / ztk_11 py_265_win32
   winbot / ztk_11 py_265_win64
   winbot / ztk_11 py_270_win32
   winbot / ztk_11 py_270_win64

Non-OK results
--

[1]FAILED  winbot / z3c.contents_py_265_32
   https://mail.zope.org/pipermail/zope-tests/2012-September/068006.html


[2]FAILED  winbot / z3c.coverage_py_265_32
   https://mail.zope.org/pipermail/zope-tests/2012-September/068009.html


[3]FAILED  winbot / z3c.layer.ready2go_py_265_32
   https://mail.zope.org/pipermail/zope-tests/2012-September/068007.html


[4]FAILED  winbot / z3c.recipe.paster_py_265_32
   https://mail.zope.org/pipermail/zope-tests/2012-September/068008.html


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )