I'm unit testing an Android app using Monkeyrunner with Jython on Eclipse.
- Eclipse: 4.2.1
- Eclipse plugin PyDev: 2.7.1
- Jython: 2.5.3
When running the tests I would like it to fail at the first assertion failure.
Shortened test script:
if __name__ == '__main__':
# unittest.main()
mDevice = getConnection()
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
#----------------------------------------------
suite0001 = unittest.TestLoader().loadTestsFromTestCase(Test_TEST0001)
suite.addTest(suite0001)
runner.run(suite)
I've read about setting some failfast parameter on this discussion: How to use TextTestRunner class from Python unittest module in failfast mode?
So I try to set this parameter like this:
...
runner = unittest.TextTestRunner(failfast=True)
...
However, when running the script, it fails:
File "c:\svnrepository\x\trunk\JythonProject\src\main.py", line 1361, in <module>
runner = unittest.TextTestRunner(failfast=True)
TypeError: __init__() got an unexpected keyword argument 'failfast'
Any suggestion?