A
A
Alexander2019-10-30 23:26:34
Python
Alexander, 2019-10-30 23:26:34

How to make the most informative report from pytest in slack?

Hey!
I have system API tests in python and pytest. They spin in gitlab ci with some frequency. Reports are sent to the mail, the report from the pytest-html package is used there. But in the slack there is a regular text message with the following content:

  • The number of failed tests that is caught in the pytest_sessionfinish hook.
  • The test class and its name (function name) collected in the pytest_runtest_makereport hook.

It is sent to Slack without any additional comments. And if, when I see the name of the test, for example, test_session_creation_succeed, I understand that the session check test has not passed now, then managers who also want to monitor the state of the system are indignant.
I have an idea to create a file with a human-readable description of each test (actually, there are not many of them, less than 50, because the checks are systemic), then map each test with the text in the report and send it to the slack channel in this way.
Tell me, is this the norm? Maybe you can do it somehow differently/easier/more correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question