Re: SimpleFormValidator obscures my docstrings (and doctests!)

Ian Bicking <[email protected]> Wed, 10 Dec 2008 22:41:13 -0600
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Thanks for the test.  You were actually using it somewhat differently 
here, not using the decorator.  Anyway, I moved the __doc__ assignment 
around, and now this works.

Matthew Wilson wrote:
> Here's a test to add to the bottom of formencode/tests/test_schema.py:
> 
> def test_SimpleFormValidator_1():
>     """
>     Verify SimpleFormValidator preserves the decorated function's
>     docstring.
>     """
> 
>     BOGUS_DOCSTRING = "blah blah blah"
> 
>     def f(value_dict, state, validator):
>        value_dict['f'] = 99
> 
>     f.__doc__ = BOGUS_DOCSTRING
>     g = SimpleFormValidator(f)
> 
>     assert f.__doc__ == g.__doc__, "Docstrings don't match!"
> 
> Right now, the test is failing.  When I print g's docstring, it still
> matches the docstring for SimpleFormValidator.
> 


-- 
Ian Bicking : [email protected] : http://blog.ianbicking.org

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/