[Pyunit-interest] Using JPython with JUnit
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2000-06-25 00:04:31
|
As a follow-up to Rob's enquiries about using PyUnit with JPython, I had a bit of a play around. I tried writing a JUnit test case using JPython; in case anyone is interested, some sample code is shown below. It's a little clunky. I can see some arguments in favour of making PyUnit work with JPython (at least with the TextTestRunner), so I'll probably plan to roll those changes into the next release. #---------------------------------------------------- import sys sys.add_package('test.framework') sys.add_package('test.textui') import test.framework import test.textui class MyTestCase(test.framework.TestCase): def __init__(self): test.framework.TestCase.__init__(self,"MyTestCase") def runTest(self): a = 1 # etc # assert a == 2 if __name__ == '__main__': testcase = MyTestCase() test.textui.TestRunner.run(testcase) #---------------------------------------------------- -- Steve Purcell, Technical Director, Inkontact Get in touch at http://www.inkontact.com/ |