: , i j.
:
for i in xrange(1, 4):
for j in xrange(2, 6):
setattr(Tests, "test_%r_%r" % (i, j), lambda self: self.check(i, j))
, , lambdas i j . , , i j , .
, i j . itertools.product, :
from itertools import product
from operator import methodcaller
for i, j in product(range(1, 4), range(2, 6)):
setattr(Tests, "test_%r_%r" % (i, j),
lambda self, i=i, j=j: self.check(i, j))
functools.partial() (.. , )
. check(i, j) , . Tests.
?
spam . self - , .
?
test_[i]_[j]() Tests.
.check() ?
, Tests self.