Oops, my mistake, I haven't seen that the hidden version of the
function was called instead of the public one...

In any case there is a real problem with the unit tests since they
passed before my change and still pass now.

I still would like to refactor the unit tests but I've been quite busy
lately... I still hope to get some time to work on it, though.

Regards,
Nicolas

2006/3/8, Graham Dumpleton <[EMAIL PROTECTED]>:
> Nicolas
>
> A while back you made the following change:
>
> r378072 | nlehuen | 2006-02-16 06:41:25 +1100 (Thu, 16 Feb 2006) | 5
> lines
>
> - Fixed the unit tests for apache.register_cleanup
> server.register_cleanup. Ther
> e is not way it could have passed before, yet it did ???
> - Corrected the documentation about those two functions, it was badly
> broken.
> - Added a warning so that users don't try to pass a request object as
> the argume
> nt to the callable.
>
> You say that you don't understand how old test failed, but I don't
> understand how the new test wouldn't fail.
>
> The apache.register_cleanup() function is defined as:
>
>    def register_cleanup(handler,data=None):
>        _apache.register_cleanup(_interpreter,_server,handler,data)
>
> Ie., the visible method takes two arguments. You changed the test to
> call it with 4.
>
> def apache_register_cleanup(req):
>
>      apache.register_cleanup(req.interpreter, req.server,
> server_cleanup, "apache_register_cleanup test ok")
>      req.write("registered server cleanup that will write to log")
>
>      return apache.OK
>
> It is only the hidden version of register_cleanup() in the _apache
> module which takes 4.
>
> As a result, the changes made to the documentation aren't correct
> either.
>
> I'll try and work out why the test harness doesn't fail with code as now
> written, although it is probably all academic given that as described
> in MODPYTHON-109, the server based register cleanup functions will not
> reliably run anyway.
>
> Most strange.
>
> Graham
>
>

Reply via email to