mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix closure in creation of generated test methods, otherwise the last testdef is used for every test
This commit is contained in:
@@ -120,8 +120,11 @@ def build_tests():
|
||||
s = ( ToolTestCase, )
|
||||
d = dict()
|
||||
for j, testdef in enumerate( tool.tests ):
|
||||
def test_tool( self ):
|
||||
self.do_it( testdef )
|
||||
test_tool.__doc__ = "%s ( %s ) > %s" % ( tool.name, tool.id, testdef.name )
|
||||
d['test_tool_%06d' % j] = test_tool
|
||||
def make_test_method( td ):
|
||||
def test_tool( self ):
|
||||
self.do_it( td )
|
||||
return test_tool
|
||||
m = make_test_method( testdef )
|
||||
m.__doc__ = "%s ( %s ) > %s" % ( tool.name, tool.id, testdef.name )
|
||||
d['test_tool_%06d' % j] = m
|
||||
G[ n ] = new.classobj( n, s, d )
|
||||
|
||||
Reference in New Issue
Block a user