I need help in translating the function
"testOtherTests" and the last line from the following
Python code (do not know if the Tabs will preserved by
Yahoo! email client).
To be specific, what is the equivalent of the lines:
result=unittest.TextTestRunner().run(othertests)
and
unittest.main()
in Ruby Test:Unit framework ?
Any help will be highly appreciated,
Thanks,
– shanko
------------------ Python Code ------------------
class TestMain(unittest.TestCase):
def setUp(self):
… code for setup …
def testRemove(self):
... code for this test ...
def testOtherTests(self):
import test_others
othertests=unittest.TestLoader().loadTestsFromModule(test_others)
result=unittest.TextTestRunner().run(othertests)
assert result.failures==[] , “Other tests returned
%i failures” % len(result.failures)
assert result.errors==[], “Other tests returned %i
errors” % len(result.errors)
print “Now continuing with the main tests:”
... some more tests ...
def tearDown(self):
.... code for tearDown...
if name == ‘main’:
unittest.main()