Python Testing with pytest, Second Edition: machine readable output

Title: Name of book: Python Testing with pytest, Second Edition

I wonder if it would be possible to provide a practical approach to generating machine-readable pytest output in the context of testing automation.

Thanks,

Alex

Alex,
There are a couple of common ways in use for pytest results.
There is the built in --junit-xml=path flag to create a junit-xml style report.
There are also plugins that generate different styles of reports, such as pytest-json-report,
You can also use tox to drive pytest and generate json from it using tox --result-json=PATH.
Hope this helps.

  • Brian

Thanks, Brian. I was trying to make a suggestion that a note like you posted above might be valuable in the book. The second edition is much improved already. I’m recommending it to my colleagues.

Cheers,

Alex

Thanks for the suggestion.