Unittest and dynamically created methods

Peter Hansen peter at engcorp.com
Tue Oct 14 17:02:07 EDT 2003


JAWS wrote:
> 
> I get this error message when trying to run a unittest test with a dynamically created test method:
> 
> Traceback (most recent call last):
>   File "unittest.py", line 215, in __call__
>     testMethod()
> TypeError: ?() takes no arguments (1 given)

I can't say offhand, but the above error might give you a hint:
it appears it's trying to report the name of the method, but
doesn't have it (thus the ?() part).  Maybe you should examine
the dynamic creation of the method more closely.  Have you 
passed the name parameter in the right place?

-Peter




More information about the Python-list mailing list