Edit : solved!
The solution will be updated soon.
Goal:
I want to rewrite the Python UnitTest module, so when I call it, I get the following JSON output in the stdout stream. For instance:
{ "errors":0, "failures":1, "ran":3, "skipped":0, "successful":2, "test_data":[ { "index":0, "result":1 }, { "index":1, "result":1 }, { "index":2, "result":-1 } ] }
Problem:
I wrote code to generate these test results, but I have problems writing code for the test_data attribute of the JSON array. I have overwritten the TestCase , TextTestResult and TextTestRunner , but I cannot figure out how to get the result from getTestsReport() :
Why not update x after calling getTestsReport() ?
Edit
Well, I think unittest.main(exit=False) was calling the wrong function! I'm trying to rewrite the code in my main one, but still encountering a number of problems:
Can anyone help me here? I'm so stuck :(
source share