Hi
I am trying to use pyUnit to create a framework for testing functions
I am reading function name, expected output, from a text file.
and in python generating dynamic test functions
something like this
class getUsStatesTest ( unittest.TestCa se ):
self.setUp = lambda : function_call
self.testReturn Val = lambda : self.assertEqua l( fileInput,
function_return edVals )
self.testLength = lambda : self.assertEqua l( len(returnedVal s)
, len(inp) )
is it possible to load these dynamic functions via pyUnit, instead of
defining in text form ,
can i use loadfromname etc to load these dynamic test functions.
something like this
unittest.TestSu ite(unittest.de faultTestLoader .loadTestsFromN ame(
getUsStatesTest () ))
in this way I can completely automate every function that returns some
output by dynamically generating its
test functions
thanks
I am trying to use pyUnit to create a framework for testing functions
I am reading function name, expected output, from a text file.
and in python generating dynamic test functions
something like this
class getUsStatesTest ( unittest.TestCa se ):
self.setUp = lambda : function_call
self.testReturn Val = lambda : self.assertEqua l( fileInput,
function_return edVals )
self.testLength = lambda : self.assertEqua l( len(returnedVal s)
, len(inp) )
is it possible to load these dynamic functions via pyUnit, instead of
defining in text form ,
can i use loadfromname etc to load these dynamic test functions.
something like this
unittest.TestSu ite(unittest.de faultTestLoader .loadTestsFromN ame(
getUsStatesTest () ))
in this way I can completely automate every function that returns some
output by dynamically generating its
test functions
thanks
Comment