So I have have pytest run my tests and that's great, but I want to actually do something with the test results. I was using unittest, and that gives me a swanky results object that I can process after the tests have run. Pytest just seems to give me a big text dump - writing a parser for that sounds mind-numbingly boring.
How do I get the results into something I can use? I must be missing something.
btw - I'm running my tests using pytest.main(), not via the command line py.test. I was hoping to have some sort of result object I can interact with at runtime. I realize I can write results to disk, read from disk, parse said results and then act on results - but it seems like those disk operations are just extra steps I should be able to avoid.
py.test result files are not really meant to be human readable. I'm not sure if there is a third-party parser for them or not. They are meant to be read by a continuous integration server like Hudson or Travis-ci. As @limelights said you get the xml files for these services with the --junitxml=path
flag. More here. or with the --resultlog=path
flag. More here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With