Re: SimpleFormValidator obscures my docstrings (and doctests!)
"Matthew Wilson" <[email protected]> Wed, 10 Dec 2008 23:36:18 -0500
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
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.
--
Matthew Wilson
[email protected]
http://tplus1.com
------------------------------------------------------------------------------
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/