Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytest - custom output of test results

I want to completely custom tests results output. In unittest I can implement my own test runner by example of unittest.TextTestRunner. How can I do the same in pytest?

like image 939
Gill Bates Avatar asked Aug 28 '13 19:08

Gill Bates


1 Answers

You'll need to work with pytest hooks:

py.test calls hook functions to implement initialization, running, test execution and reporting.

Also see:

  • py.test code snippets
  • pycon tutorial session (it also goes through using hooks)
like image 146
alecxe Avatar answered Sep 28 '22 01:09

alecxe